| Search Locate Previous Next | Contents |
This function is to help you manage the production of long documents, where extra navigation information is helpful in either the NewLeaf viewer or in a finished document published as a PDF file with Adobe Acrobat. You may also use page-references to resolve bookmark references to page numbers when the report is completed.
The simple form of the command is ...
leaf.Bookmark 'Recognising Trees' 'subhead' leaf.Place 'Tree Recognition'
The bookmark will be placed on the next item of text to be generated, using leaf.Flow, leaf.Place or any of the table commands. Bookmarks generated in this form are shown in alphabetic order in the Go to page ... dialogue in the viewer.
Making an indented outline for Adobe Acrobat
Bookmark information is included in the PostScript file generated for Distiller using PostScrp.WritePDF. In this case it will be helpful to indicate the outline level of the bookmark, with major sections at level-1 and subsidiary sections indented to form a contents tree.
leaf.Bookmark 'Recognising Trees' 1 'subhead' leaf.Place 'Tree Recognition' leaf.Bookmark 'The Larch' 2 'subhead' leaf.Place 'No.1 The Larch' leaf.Bookmark 'In winter' 3 'subhead' leaf.Place 'The Larch in Winter'
... and so on. This structure will then appear in the Acrobat Viewer outline bar to the left of the document. By default, sections will be closed on opening the document you can force the Acrobat Viewer to open a section automatically by appending 1 as the final parameter to the bookmark call:
leaf.Bookmark 'Recognising Trees' 1 1 'subhead' leaf.Place 'Tree Recognition' leaf.Bookmark 'The Larch' 2
Documents including outline information will automatically show the outline bar when opened in the Acrobat viewer.
Linking to external resources
You may add an optional 4th argument which simply creates an entry in the contents tree to point to an external resource, such as a webpage or another PDF file.
leaf.Bookmark 'External links ...' 1 1 leaf.Bookmark 'Home page' 2 0 'http://www.causeway.co.uk/'
leaf.Bookmark 'Manual' 2 0 'c:\docs\manual.pdf'
These bookmarks will be ignored by the APL document viewer.
Checking the bookmark table
If you want to construct your own viewer, with a tree-structured table of contents, you can check the page-count, title and bookmarks table with infoPostScrp.Info spl. The bookmarks table is a 3-column matrix giving the bookmark name, page number and indent level. Dummy entries (links to webpages or other PDFs) have a page number of 0 and you would probably screen these out.