Bug #73 - PDF export should support bookmarks
Product:PageStream (All Platforms)Reported By:Deron Kazmaier
Severity:EnhancementAssigned To:Deron Kazmaier
Priority:Average sign in to watch (1 is watching)
Status:NewReported:2007-08-17 18:31:50
Category:Document/LayoutUpdated:2007-08-17 18:31:50
Summary:PDF export should support bookmarks
Keywords:PDF export,bookmark
Attached Files:No files attached.
 Sign In to add a file.

The bookmarks that are inserted into a PageStream document should be exported to PDF when using Save as PDF.

Tim Doty wrote...2007-08-19 14:22:44

It should also use the chapter layout in the exported PDF

Tim Doty wrote...2007-08-20 20:03:20


By default always include the chapter layout as the PDF "bookmarks" for generated PDFs. This should not add significantly to either the final size or the time required to generate the PDF. The PDF export requester can then be enhanced with check boxes to include:

Chapters. Checked by default
Table of Contents. The code for generating a ToC would be used to create the entries
Bookmarks. The bookmarks indicated in the PgS document would be used to create links.
Index. The code for generating an index would be used to create the entries.

As far as the PDF document is concerned there is only one set of bookmarks, but they can be grouped arbitrarily. By default each type would be grouped under their own header. E.g., if "Chapters" is selected then a bookmark entry named "Chapters" can be expanded to show the chapters, etc.

If only a single type of bookmark is selected for inclusion then the parent topic can be excluded. E.g., if only "Chapters" is selected then a bookmark entry for chapter one is included at the top level (expandable to show sub chapters) then chapter two, and so on.

These options should cover the various needs and desires for including bookmarks to various chapters and locations in a document.

The relevant portion of the PDF specification appears to be 8.2, specifically 8.2.2 (Document Outline). In brief the outline dictionary is contained in the document catalog (3.6.1) and has keys of Type, First, Last and Count. Each entry has keys Title, Parent, Prev, Next, First, Last, Count, [Dest | A], SE, C and F. For the purposes of PageStream this can be condensed to Title, Parent, Prev, Next, First, Last, Count, Dest and [SE].

Type Outlines
First <indirect reference>
Last <indirect reference>
Count <total number of open items in outline>

Title (My Title)
Parent <indirect reference>
Prev <indirect reference, all but first>
Next <indirect reference, all but last>
First <indirect reference>
Last <indirect reference>
Count <total number of open descendants>
Dest <index; if v1.1 or newer can be name or byte string>
SE <for backward compatibility should also specify Dest>

Adapted from the example provided in the documentation:
21 0 obj
<< /Count 6
/First 22 0 R
/Last 29 0 R

22 0 obj
<< /Title (Chapter 1)
/Parent 21 0 R
/Next 26 0 R
/First 23 0 R
/Last 25 0 R
/Count 3
/Dest [3 0 R]

The specification also covers discontinuous articles (section 8.3) which seems to be a natural for inclusion by PgS -- at least as an option. This would work programmatically by using PgS articles and the flow from text frame to text frame.

Add a Comment
Sign in to add a comment.

Bug #73 - PDF export should support bookmarks   PDF export,bookmark
  created:2007-08-17 18:31:50   last updated:2007-08-17 18:31:50
  Copyright © 1985-2021 GrasshopperLLC. All Rights Reserved.

sign in to add a bug