|
2 | 2 | //============================================================+
|
3 | 3 | // File name : example_015.php
|
4 | 4 | // Begin : 2008-03-04
|
5 |
| -// Last Update : 2010-08-08 |
| 5 | +// Last Update : 2011-04-15 |
6 | 6 | //
|
7 | 7 | // Description : Example 015 for TCPDF class
|
8 | 8 | // Bookmarks (Table of Content)
|
|
66 | 66 |
|
67 | 67 | // ---------------------------------------------------------
|
68 | 68 |
|
69 |
| -// Bookmark($txt, $level=0, $y=-1, $page='') |
| 69 | +// Bookmark($txt, $level=0, $y=-1, $page='', $style='', $color=array(0,0,0)) |
70 | 70 |
|
71 | 71 | // set font
|
72 | 72 | $pdf->SetFont('times', 'B', 20);
|
|
75 | 75 | $pdf->AddPage();
|
76 | 76 |
|
77 | 77 | // set a bookmark for the current position
|
78 |
| -$pdf->Bookmark('Chapter 1', 0, 0); |
| 78 | +$pdf->Bookmark('Chapter 1', 0, 0, '', 'B', array(0,64,128)); |
79 | 79 |
|
80 | 80 | // print a line using Cell()
|
81 | 81 | $pdf->Cell(0, 10, 'Chapter 1', 0, 1, 'L');
|
|
88 | 88 | // add other pages and bookmarks
|
89 | 89 |
|
90 | 90 | $pdf->AddPage();
|
91 |
| -$pdf->Bookmark('Paragraph 1.1', 1, 0); |
| 91 | +$pdf->Bookmark('Paragraph 1.1', 1, 0, '', '', array(0,0,0)); |
92 | 92 | $pdf->Cell(0, 10, 'Paragraph 1.1', 0, 1, 'L');
|
93 | 93 |
|
94 | 94 | $pdf->AddPage();
|
95 |
| -$pdf->Bookmark('Paragraph 1.2', 1, 0); |
| 95 | +$pdf->Bookmark('Paragraph 1.2', 1, 0, '', '', array(0,0,0)); |
96 | 96 | $pdf->Cell(0, 10, 'Paragraph 1.2', 0, 1, 'L');
|
97 | 97 |
|
98 | 98 | $pdf->AddPage();
|
99 |
| -$pdf->Bookmark('Sub-Paragraph 1.2.1', 2, 0); |
| 99 | +$pdf->Bookmark('Sub-Paragraph 1.2.1', 2, 0, '', 'I', array(0,0,0)); |
100 | 100 | $pdf->Cell(0, 10, 'Sub-Paragraph 1.2.1', 0, 1, 'L');
|
101 | 101 |
|
102 | 102 | $pdf->AddPage();
|
103 |
| -$pdf->Bookmark('Paragraph 1.3', 1, 0); |
| 103 | +$pdf->Bookmark('Paragraph 1.3', 1, 0, '', '', array(0,0,0)); |
104 | 104 | $pdf->Cell(0, 10, 'Paragraph 1.3', 0, 1, 'L');
|
105 | 105 |
|
106 | 106 | $pdf->AddPage();
|
107 |
| -$pdf->Bookmark('Chapter 2', 0, 0); |
| 107 | +$pdf->Bookmark('Chapter 2', 0, 0, '', 'BI', array(128,0,0)); |
108 | 108 | $pdf->Cell(0, 10, 'Chapter 2', 0, 1, 'L');
|
109 | 109 |
|
110 | 110 | $pdf->AddPage();
|
111 |
| -$pdf->Bookmark('Chapter 3', 0, 0); |
| 111 | +$pdf->Bookmark('Chapter 3', 0, 0, '', 'B', array(0,64,128)); |
112 | 112 | $pdf->Cell(0, 10, 'Chapter 3', 0, 1, 'L');
|
113 | 113 |
|
114 | 114 | // ---------------------------------------------------------
|
|
117 | 117 | $pdf->Output('example_015.pdf', 'I');
|
118 | 118 |
|
119 | 119 | //============================================================+
|
120 |
| -// END OF FILE |
| 120 | +// END OF FILE |
121 | 121 | //============================================================+
|
0 commit comments