Example #1
0
// get around more easily in large PDF documents.
$red->SetColor(1.0, 0.0, 0.0);
$green->SetColor(0.0, 1.0, 0.0);
$green->SetFlags(2);
// set bold font
$blue->SetColor(0.0, 0.0, 1.0);
$blue->SetFlags(3);
// set bold and italic
$doc->Save($output_path . "bookmark.pdf", 0);
// The following example illustrates how to traverse the outline tree using
// Bookmark navigation methods: Bookmark.GetNext(), Bookmark.GetPrev(),
// Bookmark.GetFirstChild () and Bookmark.GetLastChild ().
// Open the document that was saved in the previous code sample
$doc = new PDFDoc($output_path . "bookmark.pdf");
$doc->InitSecurityHandler();
$root = $doc->GetFirstBookmark();
PrintOutlineTree($root);
echo "Done.";
// The following example illustrates how to create a Bookmark to a page
// in a remote document. A remote go-to action is similar to an ordinary
// go-to action, but jumps to a destination in another PDF file instead
// of the current file. See Section 8.5.3 'Remote Go-To Actions' in PDF
// Reference Manual for details.
// Open the document that was saved in the previous code sample
$doc = new PDFDoc($output_path . "bookmark.pdf");
$doc->InitSecurityHandler();
// Create file specification (the file referred to by the remote bookmark)
$file_spec = $doc->CreateIndirectDict();
$file_spec->PutName("Type", "Filespec");
$file_spec->PutString("F", "bookmark.pdf");
$spec = new FileSpec($file_spec);