# How to Add Bookmarks to a Scanned PDF from Its Contents Page

Canonical: https://pdfbookmarks.com/how-to-add-bookmarks-to-scanned-pdf
Updated: 2026-11-27

A scanned book or report is a stack of page images. It has no text layer, so no tool can find headings by font size and you cannot select or search anything. The printed contents page, however, already lists every chapter with its page number - exactly the information bookmarks need.

The catch is that those numbers are printed page numbers, and they rarely match the page numbers of the PDF: the cover, the copyright page and the contents pages themselves push everything down, so "Chapter 1 ... 1" may sit on page 4 of the file. This guide reads the contents page with OCR running locally in your browser, turns it into bookmarks, and shows how to get the page offset right. Your PDF is never uploaded.

## First, check that the PDF really is a scan

Try to select a line of text on a page. If the pointer never turns into a text cursor and you can only drag a box over the page, the page is an image. The tool makes the same call itself: when the first five pages average fewer than about 20 characters of readable text per page, it treats the file as a scan and switches to OCR.

A PDF that already has a text layer does not need OCR - "Auto-generate" reads that text directly - so everything below is for image-only files.

## Let Auto-generate read the contents page

1. Open the PDF bookmark editor and drop in the scanned PDF - it is read locally, never uploaded
2. Click "Auto-generate" in the Bookmarks panel
3. Wait while it works. The status line changes from "Loading OCR model (slow on first run)..." to "Running OCR on page N..." as it searches for the contents page. The first run downloads about 30 MB of OCR model files from this site, which is why the status warns about it
4. When it finishes, a "Confirm replacement" box says how many root bookmarks it found. Click "Confirm" to replace the bookmarks in the panel with them
5. Check the result using the next two sections, then click "Save PDF"

## What the OCR step does

It reads the first pages one at a time - up to page 16 - looking for the contents page: a short heading such as "Contents" followed by lines in the form "title ..... number", with common OCR slips in the heading tolerated. A contents page with no heading is accepted only when it has a long run of such lines. If the contents run onto more pages, it keeps reading until a page no longer has numbered entries.

Levels come from indentation when the contents use two to five indent levels; with no usable indentation it falls back to numbering such as "Chapter 3" or "1.2". The last number on each line is taken as the printed page. OCR sometimes drops a digit (reading 25 as 5); because a contents list never goes backwards, a number lower than the one before it is raised to that earlier number instead of being trusted, so check entries that look too early. A line whose page number OCR lost entirely is still kept if it begins like a chapter heading ("Chapter 3 Methods", "第三章 方法"); it borrows the page of a neighbouring entry, so check those too.

To turn printed pages into PDF pages it looks at the first few pages after the contents and reads the printed page numbers in their top and bottom margins (formats such as 12, Page 12 or - 12 -). The most common difference between the PDF page and the printed number becomes the page offset. If the body has no printed numbers, it looks on those pages for the titles of the first three contents entries and uses the page where one appears. If neither works it assumes no offset, and every bookmark lands the same number of pages too early.

## Check the page numbers

Open the Bookmarks panel and click three entries - the first chapter, one in the middle and the last - to see where each one lands in the preview. If all three land on the right page, you are done: click "Save PDF".

If they all miss by the same number of pages, the page offset is wrong (see the next section). If only some miss, OCR misread those numbers or titles: hover over an entry to reveal the pencil ("Edit bookmark") and correct its title or page, and drag entries to reorder or nest them. An entry whose page ended up beyond the last page of the PDF is left out of the result, so a chapter missing at the end is a sign the offset came out too high.

## Fix a constant page offset with the contents text

When every bookmark is off by the same number of pages, redo the import with the offset set by hand. The offset is the PDF page where a chapter really starts minus the page number printed in the contents: if the contents say Chapter 1 starts on page 1 and it is on page 4 of the PDF, the offset is 3.

1. In the Bookmarks panel, click "Import bookmarks from TOC text"
2. Paste the contents as text, one entry per line with the page number at the end. Numbering ("1", "1.1", "Chapter 2") or indentation sets the level. If you only have an image of the contents page, the dialog suggests running OCR on it first
3. Enter the offset in "Page Offset". The dialog states the rule: Actual PDF Page = TOC Page + Offset
4. Look at the "Parse Preview" on the right. When it looks right, choose "Replace All Bookmarks" (or "Append to Existing" to keep the bookmarks you already have)
5. Click a few bookmarks to confirm they land correctly, then click "Save PDF"

## When Auto-generate finds nothing

If it finishes without a result, the editor leaves a panel in the sidebar instead of a message that disappears: it offers "Import bookmarks from TOC text", and the English and Chinese site also link to PDFBookmarks AI for scanned contents pages. Common reasons: the contents page is later than page 16, fewer than two entries could be read, the contents list has no page numbers, or the scan is too faint, skewed or low-resolution for the OCR.

In those cases type or paste the entries yourself with "Import bookmarks from TOC text", or add bookmarks one by one with "Add bookmark" while you page through the preview. PDFBookmarks AI is a local tool, with its source on GitHub, that lets an AI agent that can look at images read the contents page and save a new PDF on your own device; what the agent looks at goes to its model, so use a local model if the content must stay on your device.

## FAQ

### Can I add bookmarks to a scanned PDF for free without uploading it?

Yes. Auto-generate reads the contents page with an OCR model that runs in your browser. Only the OCR engine and model files are downloaded, from this site; your PDF stays on your device. There is no sign-up and no watermark.

### Do I have to make the scan searchable first?

No. Auto-generate runs OCR itself on the pages it needs: the first pages while it looks for the contents, and a few pages after the contents to work out the page offset.

### The contents page is on page 20. Will it be found?

Auto-generate searches the first 16 pages only. If your contents page is later, copy its entries as text and use "Import bookmarks from TOC text" with the right "Page Offset".

### Why are all my bookmarks a few pages off?

The numbers in a contents page are printed page numbers, and the PDF has extra pages in front (cover, copyright page, the contents themselves). The tool estimates the difference from printed numbers in the page margins; when the body has none, it may assume zero. Redo the import with the offset set by hand, as described above.

### My contents list the preface with roman numerals (i, ii, iii). Are those picked up?

No. Only Arabic digits are read as page numbers. A plain line such as "Preface ..... iii" is skipped; a line that begins like a chapter heading, such as "Chapter 1 Introduction ..... iii", is kept but borrows the page of a neighbouring entry. Roman numerals in the page margins do not count when the offset is estimated. Check those entries and add any missing ones by hand with "Add bookmark".

### Can I edit the bookmarks after they are generated?

Yes. Drag entries to reorder or nest them, hover over one to edit its title or page, or delete the ones that were misread. Nothing is final until you click "Save PDF".
