Bookmarks give readers a direct route to sections in a long PDF. A document can remain readable without them, but a useful outline can make navigation easier. The time needed depends on the source structure and authoring software.
Outline Structure
| Outline Element | Holds | Notes |
|---|---|---|
| Title | Display label | Text string; character encoding and viewer support affect display |
| Destination | Page + view | Explicit or named destination |
| Parent / Child links | Tree position | Enables nesting up to many levels |
| Next / Prev | Siblings | Defines display order |
| Color & style | Optional visual cues | Bold/italic for top-level chapters |
| Action | Optional richer behaviour | JavaScript, URI — use sparingly |
Manual vs Programmatic Bookmarks
For a short document, manual bookmarks in a PDF editor may be convenient. For regenerated reports, programmatic outlines may be easier to maintain. PyMuPDF and iText offer outline features; pdf-lib has no high-level bookmark API, so outline creation needs low-level objects or another library. Heading extraction is a separate step.
Good Bookmark Hygiene
- Mirror the visible heading hierarchy — H1 = top level, H2 = child, etc.
- Use concise, descriptive labels. About 60 characters can be an editorial starting point, not a PDF limit; check wrapping in target readers.
- Use stable destinations for chapter starts. Both named destinations and explicit page references need verification after page edits; displayed page numbers are not reliable identifiers.
- Set the document's
PageModetoUseOutlinesto request an open outline panel; viewers can ignore this preference. - Test outlines in intended desktop and mobile readers; nesting, navigation controls and display vary by application.
Common Problems
- Wrong destinations: inspect how the authoring or editing tool generated bookmark destinations. Re-export or repair them as appropriate, then test each link; enabling bookmarks alone may not fix incorrect destinations.
- Outline panel hidden by default: set
PageMode = UseOutlinesin the catalog. - Wrong zoom on click: choose Fit, FitH or an appropriate XYZ destination for the intended view. XYZ can specify coordinates and zoom, or retain current values when those parameters are null.
- Broken after merge: use a merge tool that preserves outlines and re-targets pages.
A Quick Workflow to Add Bookmarks
The fastest reliable path depends on where the document comes from:
- Authoring in a word processor? Apply real heading styles (Heading 1, 2, 3). If the PDF exporter offers bookmarks from headings, enable that option. Export options differ between Word versions and Google Docs; inspect the resulting PDF rather than assuming an identical setting or outline.
- Exporting from LaTeX? The
hyperrefpackage builds the outline automatically from your\sectionhierarchy. - Working with an existing flat PDF? Open it in a PDF editor, turn on the outline panel, and add a top-level entry at each chapter start, nesting sub-sections beneath. Use only the nesting needed for navigation and test it in the intended readers; three levels is a design convention, not a compatibility guarantee.
- Regenerating the file often? Use a library with outline support and supply an explicit heading-to-page mapping. Recheck the mapping after pagination changes; pdf-lib requires a separate low-level implementation.
Whichever route you take, finish by setting PageMode to UseOutlines to request an open panel in supporting viewers, and click through every entry once to confirm the destinations land where you expect.
Combine Sectioned PDFs
Merge chapter PDFs in your chosen page order. This tool does not preserve document bookmarks; rebuild and verify the outline in a PDF editor afterward.
Merge PDF →