28require_once(
'tcpdf_include.php');
43 $this->
Image(
$img_file, 0, 0, 210, 297,
'',
'',
'',
false, 300,
'',
false,
false, 0);
56$pdf->SetAuthor(
'Nicola Asuni');
57$pdf->SetTitle(
'TCPDF Example 051');
58$pdf->SetSubject(
'TCPDF Tutorial');
59$pdf->SetKeywords(
'TCPDF, PDF, example, test, guide');
69$pdf->SetHeaderMargin(0);
70$pdf->SetFooterMargin(0);
73$pdf->setPrintFooter(
false);
82if (@file_exists(dirname(__FILE__).
'/lang/eng.php')) {
83 require_once(dirname(__FILE__).
'/lang/eng.php');
84 $pdf->setLanguageArray(
$l);
90$pdf->SetFont(
'times',
'', 48);
96$html =
'<span style="background-color:yellow;color:blue;"> PAGE 1 </span>
97<p stroke="0.2" fill="true" strokecolor="yellow" color="blue" style="font-family:helvetica;font-weight:bold;font-size:26pt;">You can set a full page background.</p>';
98$pdf->writeHTML(
$html,
true,
false,
true,
false,
'');
105$html =
'<span style="background-color:yellow;color:blue;"> PAGE 2 </span>';
106$pdf->writeHTML(
$html,
true,
false,
true,
false,
'');
111$pdf->setPrintHeader(
false);
124$pdf->SetAutoPageBreak(
false, 0);
127$pdf->Image(
$img_file, 0, 0, 210, 297,
'',
'',
'',
false, 300,
'',
false,
false, 0);
135$html =
'<span style="color:white;text-align:center;font-weight:bold;font-size:80pt;">PAGE 3</span>';
136$pdf->writeHTML(
$html,
true,
false,
true,
false,
'');
141$pdf->Output(
'example_051.pdf',
'I');
An exception for terminatinating execution or to throw for unit testing.
Header()
This method is used to render the page header.
PHP class for generating PDF documents without requiring external extensions.
setPageMark()
Set start-writing mark on current page stream used to put borders and fills.
SetAutoPageBreak($auto, $margin=0)
Enables or disables the automatic page breaking mode.
Image($file, $x='', $y='', $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false, $alt=false, $altimgs=array())
Puts an image in the page.
getBreakMargin($pagenum='')
Returns the page break margin.
$bMargin
Page break margin.
$AutoPageBreak
Automatic page breaking.
const PDF_FONT_NAME_MAIN
Default main font name.
const PDF_MARGIN_RIGHT
Right margin.
const PDF_PAGE_FORMAT
Page format.
const PDF_CREATOR
Document creator.
const PDF_MARGIN_BOTTOM
Bottom margin.
const PDF_FONT_MONOSPACED
Default monospaced font name.
const PDF_MARGIN_TOP
Top margin.
const PDF_PAGE_ORIENTATION
Page orientation (P=portrait, L=landscape).
const PDF_UNIT
Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
const PDF_MARGIN_LEFT
Left margin.
const PDF_FONT_SIZE_MAIN
Default main font size.
const PDF_IMAGE_SCALE_RATIO
Ratio used to adjust the conversion of pixels to user units.
const K_PATH_IMAGES
Installation path (/var/www/tcpdf/).