Veröffentlicht
What a Table of Contents Does, and Why Some PDFs Lack One
The sidebar you can click through chapter by chapter isn't part of a PDF's pages — it's a separate, optional structure some files carry and others simply don't. Here's what generates it, why scans almost never have one, and how EPUB avoids the problem by requiring it outright.
What a PDF's table of contents actually is
Open one long PDF and there's a panel on the side you can click through, chapter by chapter. Open another and there's nothing — just page 1 of 140, and you're on your own. That difference has nothing to do with how important the document is. It comes down to a structural fact about how the file was made.
The printed "Contents" page some PDFs have — the one with a list of headings and page numbers sitting on page 2 — isn't what makes a sidebar clickable. It's just page content: text and numbers, laid out like any other paragraph, with no more function than a heading on page 40. The real navigational structure lives somewhere else entirely: a separate tree of named jump-points, each pointing at a destination inside the document. Apple's PDFKit framework calls this the outline — a hierarchy of PDFOutline nodes, exposed from the document's outlineRoot, that a reader app walks to build the panel you tap through. A PDF can have a beautifully typeset contents page on page 2 and zero entries in that tree. The two don't have to agree, because they aren't the same thing.
Since the outline tree is optional at the file-format level, reader software has to treat "no outline" as a normal, expected state — not a bug. Apple's own guidance for developers is to check whether outlineRoot exists before using it, precisely because plenty of otherwise-fine PDFs simply don't have one.
Why some PDFs have nothing
The outline isn't something a PDF viewer generates by inspecting the finished file. It's built upstream, during export, from structure that already existed in the source document. Write something in Word or Google Docs, mark a line as "Heading 2," and that tag travels with the file. Export to PDF, and the outline gets built automatically from those heading styles — no extra step required.
That's also why scans almost never have one. A scanned page is an image. There's no "Heading 2" anywhere in a photograph of a page — no source structure at all for an export step to convert — so nothing gets generated. Run the scan through OCR and it may pick up a searchable text layer, but a text layer isn't a heading hierarchy. Something still has to decide which lines are headings before an outline can exist.
One more layer to this: PDF's tagged-structure system — defined under ISO 32000 — adds accessibility and text-extraction metadata on top of the visual layout, separate from the outline tree. Support for tagging is uneven across the tools that produce PDFs, so plenty of files in circulation carry neither a tagged structure nor an outline. The pattern holds either way: whether a given PDF is navigable depends entirely on its production pipeline, not on its length, its subject, or how carefully it was written.
EPUB does it differently
PDF was built to preserve a fixed visual page — same layout, same line breaks, on any screen. EPUB was built the opposite way, as reflowable content that resizes to fit whatever device is showing it. Reflowable content can't lean on "page 2 has the contents" the way a fixed layout can, so EPUB's specification requires every valid publication to ship a standardized Navigation Document containing a toc element. It's a required file, not an optional tree — a compliant EPUB can't simply be missing its navigation the way a PDF can be missing its outline.
In practice, that means every EPUB reading system can build a consistent contents panel without book-specific guesswork, because every valid EPUB carries the same predictable structure. A PDF reader has no such guarantee. It has to work with whatever the file happens to contain, which is sometimes everything and sometimes nothing.
Why it matters more than it seems
On a phone, the gap between "has an outline" and "doesn't" is the difference between tapping straight to the section you need and thumb-scrolling through dozens of pages to find it. It matters most for exactly the documents where it's most often missing: long files, scanned contracts, dense reports — see how to read a long PDF in pieces for what to do when there's nothing to click. A two-page memo was never going to need a table of contents. A 140-page one benefits enormously.
It isn't purely a convenience question, either. An outline gives you the shape of a document — what's in it, how it's organized — before you've committed to reading a single page. Losing that isn't just slower navigation; it's losing a preview of the whole thing.
How Margina handles it
Margina reads whatever outline structure a PDF or EPUB actually carries and shows it as-is. It doesn't invent a table of contents where the file has none, and it doesn't try to guess your headings from a wall of unstructured text. When a document does carry real structure, that means genuine chapter-level navigation without leaving the app. When it doesn't, your reading position is still remembered exactly where you left off — Margina just isn't going to pretend a scan has a table of contents it never had. None of this depends on an account; the free tier covers it like everything else, because opening a file and seeing what's actually inside it shouldn't require signing up for anything.
Frequently Asked Questions
Is a PDF's table of contents the same as its bookmarks?
Yes — in a PDF, "bookmarks," "outline," and "table of contents" all refer to the same thing: a hierarchy of named jump-points stored separately from any printed contents page in the document body. A reader app renders that hierarchy as a clickable sidebar panel.
Why does my PDF have a printed contents page but no clickable outline?
A printed table of contents is just page content — text and page numbers laid out like any other paragraph. The clickable outline is a distinct structure the file either carries or doesn't. A document can have a beautifully typeset contents page and zero entries in its outline tree if whatever produced the PDF never wrote one.
Can I add a table of contents to a PDF that doesn't have one?
Often, yes, if the underlying text is selectable — a reader or editor can let you mark headings and build the outline manually. If the PDF is a scan with no text layer, there's no structure to work from until it's run through OCR, and even then, someone still has to decide what counts as a heading.
Why do scanned documents almost never have a table of contents?
Outline entries are generated from a source document's heading styles — word processors track which text is "Heading 2" versus body text, and that travels into the exported PDF automatically. A scanned page is just an image; there's no heading metadata to convert, so nothing gets generated.