Get a PDF's table of contents out as text
The bookmarks panel in a PDF reader is a ready-made outline — if the file has one. How to list it with page numbers and copy it.
Tools used in this guide
The job
A 300-page spec has bookmarks but you need the outline as plain text — for a wiki index, to diff two versions, or to paste into notes.
Read the outline
Drop the PDF in and run the reader. The tree appears with nesting preserved and a page number for every bookmark that links to a page. Copy the list or download it as .txt.
- Bookmarks pointing at external URLs or actions are listed without a page number.
- A PDF with no bookmarks reports exactly that — most exported documents, scans, and many official forms simply have none.
Worked example
A manual's outline reads: "Getting started … p. 3", nested "System requirements … p. 4". The copied text keeps the indentation, so it can go straight into a document outline.
Limits
Read-only — it does not add or edit bookmarks, and it cannot see a printed table of contents that exists only as page text (that lives in the page content; use PDF to text instead). Files up to 25 MiB, processed in the browser.