28require_once(
'tcpdf_include.php');
38 $this->
Image($image_file, 10, 10, 15,
'',
'JPG',
'',
'T',
false, 300,
'',
false,
false, 0,
false,
false,
false);
40 $this->
SetFont(
'helvetica',
'B', 20);
42 $this->
Cell(0, 15,
'<< TCPDF Example 003 >>', 0,
false,
'C', 0,
'', 0,
false,
'M',
'M');
50 $this->
SetFont(
'helvetica',
'I', 8);
52 $this->
Cell(0, 10,
'Page '.$this->
getAliasNumPage().
'/'.$this->
getAliasNbPages(), 0,
false,
'C', 0,
'', 0,
false,
'T',
'M');
61$pdf->SetAuthor(
'Nicola Asuni');
62$pdf->SetTitle(
'TCPDF Example 003');
63$pdf->SetSubject(
'TCPDF Tutorial');
64$pdf->SetKeywords(
'TCPDF, PDF, example, test, guide');
88if (@file_exists(dirname(__FILE__).
'/lang/eng.php')) {
89 require_once(dirname(__FILE__).
'/lang/eng.php');
90 $pdf->setLanguageArray(
$l);
96$pdf->SetFont(
'times',
'BI', 12);
105Custom page header and footer are defined by extending the
TCPDF class and overriding the Header() and Footer() methods.
109$pdf->Write(0,
$txt,
'', 0,
'C',
true, 0,
false,
false, 0);
114$pdf->Output(
'example_003.pdf',
'I');
An exception for terminatinating execution or to throw for unit testing.
Footer()
This method is used to render the page footer.
Header()
This method is used to render the page header.
PHP class for generating PDF documents without requiring external extensions.
Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M')
Prints a cell (rectangular area) with optional borders, background color and character string.
getAliasNbPages()
Returns the string alias used for the total number of pages.
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.
SetY($y, $resetx=true, $rtloff=false)
Moves the current abscissa back to the left margin and sets the ordinate.
getAliasNumPage()
Returns the string alias used for the page number.
SetFont($family, $style='', $size=null, $fontfile='', $subset='default', $out=true)
Sets the font used to print character strings.
const PDF_FONT_NAME_MAIN
Default main font name.
const PDF_MARGIN_FOOTER
Footer margin.
const PDF_MARGIN_RIGHT
Right margin.
const PDF_PAGE_FORMAT
Page format.
const PDF_HEADER_STRING
Header description string.
const PDF_HEADER_TITLE
Header title.
const PDF_MARGIN_HEADER
Header margin.
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_FONT_NAME_DATA
Default data font name.
const PDF_FONT_SIZE_DATA
Default data font size.
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/).
const PDF_HEADER_LOGO_WIDTH
Header logo image width in user units.
const PDF_HEADER_LOGO
Deafult image logo used be the default Header() method.