From 4dcc093768d17622e169071c234571fb28d24604 Mon Sep 17 00:00:00 2001
From: Brian Manning <bdmanning@ucsd.edu>
Date: Mon, 25 Apr 2016 13:10:30 -0700
Subject: [PATCH] tcpdf_demo: added demo of PDF bookmarks

---
 tcpdf_demo | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/tcpdf_demo b/tcpdf_demo
index bd7db51..71ec159 100755
--- a/tcpdf_demo
+++ b/tcpdf_demo
@@ -51,11 +51,18 @@ $pdf->setPrintFooter(FALSE);
 
 // write out the contents of the first page
 $pdf->AddPage();
+
+// add a target to the top of the first page
 $topLink = $pdf->AddLink();
 $pdf->SetLink($topLink);
-//$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
+
+// add a bookmark too
+// - text, indent level, Y position, target page number, style, color,
+//   X position, link ID
+$pdf->Bookmark("Page 1", 0, 0, '', 'B');
+
+// set the font and size
 $pdf->AddFont('dejavusanscondensed','','dejavusanscondensed.php',true);
-//$pdf->SetFont('DejaVu', '', 20);
 $pdf->SetFont('dejavusanscondensed', '', 20);
 $pdf->SetFont('', 'U');
 $ssfLink = $pdf->AddLink();
@@ -78,6 +85,11 @@ $ssfTemplate= $pdf->importPage(1);
 
 // add the SSF file to the 2nd page
 $pdf->AddPage();
+// add a bookmark
+// - text, indent level, Y position, target page number, style, color,
+//   X position, link ID
+$pdf->Bookmark("Page 2", 0, 0, '', 'B');
+
 $pdf->SetLink($ssfLink);
 $pdf->useTemplate($ssfTemplate);
 $pdf->SetFont('Helvetica');
-- 
1.9.1