28 require_once(
'tcpdf_include.php');
70 $pdf->SetAuthor(
'Nicola Asuni');
71 $pdf->SetTitle(
'TCPDF Example 059');
72 $pdf->SetSubject(
'TCPDF Tutorial');
73 $pdf->SetKeywords(
'TCPDF, PDF, example, test, guide');
97 if (@file_exists(dirname(__FILE__).
'/lang/eng.php')) {
98 require_once(dirname(__FILE__).
'/lang/eng.php');
99 $pdf->setLanguageArray(
$l);
103 $pdf->SetFont(
'helvetica',
'', 10);
113 $pdf->Bookmark(
'Chapter 1', 0, 0,
'',
'B',
array(0,64,128));
116 $pdf->Cell(0, 10,
'Chapter 1', 0, 1,
'L');
119 $pdf->Bookmark(
'Paragraph 1.1', 1, 0,
'',
'',
array(128,0,0));
120 $pdf->Cell(0, 10,
'Paragraph 1.1', 0, 1,
'L');
123 $pdf->Bookmark(
'Paragraph 1.2', 1, 0,
'',
'',
array(128,0,0));
124 $pdf->Cell(0, 10,
'Paragraph 1.2', 0, 1,
'L');
127 $pdf->Bookmark(
'Sub-Paragraph 1.2.1', 2, 0,
'',
'I',
array(0,128,0));
128 $pdf->Cell(0, 10,
'Sub-Paragraph 1.2.1', 0, 1,
'L');
131 $pdf->Bookmark(
'Paragraph 1.3', 1, 0,
'',
'',
array(128,0,0));
132 $pdf->Cell(0, 10,
'Paragraph 1.3', 0, 1,
'L');
135 for ($i = 2; $i < 12; $i++) {
137 $pdf->Bookmark(
'Chapter '.$i, 0, 0,
'',
'B',
array(0,64,128));
138 $pdf->Cell(0, 10,
'Chapter '.$i, 0, 1,
'L');
149 $pdf->SetFont(
'times',
'B', 16);
150 $pdf->MultiCell(0, 0,
'Table Of Content', 0,
'C', 0, 1,
'',
'',
true, 0);
152 $pdf->SetFont(
'helvetica',
'', 10);
169 $bookmark_templates[0] =
'<table border="0" cellpadding="0" cellspacing="0" style="background-color:#EEFAFF"><tr><td width="155mm"><span style="font-family:times;font-weight:bold;font-size:12pt;color:black;">#TOC_DESCRIPTION#</span></td><td width="25mm"><span style="font-family:courier;font-weight:bold;font-size:12pt;color:black;" align="right">#TOC_PAGE_NUMBER#</span></td></tr></table>';
170 $bookmark_templates[1] =
'<table border="0" cellpadding="0" cellspacing="0"><tr><td width="5mm"> </td><td width="150mm"><span style="font-family:times;font-size:11pt;color:green;">#TOC_DESCRIPTION#</span></td><td width="25mm"><span style="font-family:courier;font-weight:bold;font-size:11pt;color:green;" align="right">#TOC_PAGE_NUMBER#</span></td></tr></table>';
171 $bookmark_templates[2] =
'<table border="0" cellpadding="0" cellspacing="0"><tr><td width="10mm"> </td><td width="145mm"><span style="font-family:times;font-size:10pt;color:#666666;"><i>#TOC_DESCRIPTION#</i></span></td><td width="25mm"><span style="font-family:courier;font-weight:bold;font-size:10pt;color:#666666;" align="right">#TOC_PAGE_NUMBER#</span></td></tr></table>';
186 $pdf->Output(
'example_059.pdf',
'D');
const PDF_MARGIN_BOTTOM
Bottom margin.
const PDF_MARGIN_LEFT
Left margin.
const PDF_MARGIN_HEADER
Header margin.
Header()
Overwrite Header() method.
const PDF_HEADER_STRING
Header description string.
const PDF_FONT_SIZE_MAIN
Default main font size.
const PDF_FONT_SIZE_DATA
Default data font size.
const PDF_FONT_NAME_MAIN
Default main font name.
PHP class for generating PDF documents without requiring external extensions.
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.
const PDF_UNIT
Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch].
const PDF_IMAGE_SCALE_RATIO
Ratio used to adjust the conversion of pixels to user units.
const PDF_PAGE_ORIENTATION
Page orientation (P=portrait, L=landscape).
Create styles array
The data for the language used.
TCPDF class extension with custom header and footer for TOC page.
const PDF_MARGIN_RIGHT
Right margin.
const PDF_HEADER_TITLE
Header title.
const PDF_FONT_NAME_DATA
Default data font name.
const PDF_CREATOR
Document creator.
Footer()
Overwrite Footer() method.
const PDF_PAGE_FORMAT
Page format.
const PDF_FONT_MONOSPACED
Default monospaced font name.
const PDF_MARGIN_TOP
Top margin.
const PDF_MARGIN_FOOTER
Footer margin.