Deep Dive / PDF
Why your PDF has a contents page but no bookmarks.
Three PDFs. Identical pages. Different navigation.
Open each file in Unwrap and watch what happens in the sidebar.
The experiment
The same document, in three versions.
Bookmarks
A built-in outline defines the navigation.
Link annotations
Navigation is reconstructed from clickable areas.
Plain text
A contents list is visible, but has no explicit destinations.
Anatomy of a link annotation
- Overlapping text
- The label comes from the visible text inside the clickable area.
- Link destination
- The annotation tells Unwrap which PDF page to open. Here it points to page 4. The printed number plays no part in the jump.
Reconstructing the missing outline
A link annotation defines a clickable rectangle and a destination. The rectangle tells the viewer where a click counts. The destination tells it which page to open. To recover a chapter title, Unwrap looks for visible text overlapping that rectangle.
Unwrap checks groups of internal links near the beginning of the PDF. The first links in PDF 02 point to pages three, four, four and four. Repeated destinations are fine when several sections start on the same page. Unwrap joins the overlapping text for each link and trims dot leaders — contiguous or spaced, as in many LaTeX contents pages — and the text after them.
When the evidence runs out
In PDF 03, “A snapshot, not a backup ...... 4” is plain text. You can recognize it as a chapter title and a page number. A viewer would have to infer whether the line belongs to a chapter list and whether the printed number matches a page in the file. An unnumbered cover or a separately numbered preface can break that assumption.
A clickable contents page can also fall short if it has too few eligible links, inconsistent destinations, or little usable text under the rectangles. Even a consistent group only shows where the links actually point.
Unwrap leaves the sidebar empty when the evidence falls short.
Technical notes
Checked against Unwrap 0.8.0 on .
If a PDF has usable bookmarks, Unwrap shows them as they are and stops there.
Without bookmarks, Unwrap looks at the first few pages for a group of internal links that behaves like a contents page. There have to be enough of them, they have to point forward through the document in reading order, and they have to lead to more than one page. A few out-of-order links are tolerated; a group that jumps around is not.
For each link, the label comes from the text under its clickable area. Dot leaders (dense Word-style runs or spaced LaTeX-style “. . . .”) and the printed page number are removed, and duplicates are dropped. If too few clean entries remain, Unwrap shows no outline rather than a partial one.
When most entries start with decimal section numbers such as 1, 1.2 and 1.2.3, Unwrap nests the outline from that numbering. Otherwise it stays flat. The destinations come from the file itself, so Unwrap can tell where a link points but not whether the author linked the right chapter.