All apps

PDF Indexer

Create a PDF and CSV mapping

PDF Indexer pairs one PDF with a table that says which title starts on which page. Give this page to an LLM, or follow the same rules yourself, to create files the app can review and import.

Files to create

Create one final PDF and one UTF-8 CSV. Matching names are recommended:

my-document.pdf
my-document.csv

Import the PDF first, then choose the CSV as its mapping. The filenames do not need to match, but matching names make the pair easier to manage.

PDF requirements

CSV requirements

Use comma-delimited UTF-8 CSV with one header row. The canonical columns are below.

ColumnRequiredValue
titleYesThe title shown in search results. It cannot be blank.
pageYesA positive whole number within the final PDF.
aliasesNoAlternate searchable titles separated by a semicolon or vertical bar.
Any other named columnNoA searchable detail such as composer, category, topic, date, or keyword.

Complete example

title,page,aliases,category,keywords
Introduction,3,"Overview;Preface",Front matter,"setup;basics"
Autumn Leaves,18,"Les feuilles mortes",Song,"jazz standard"
Blue in Green,27,"Blue & Green;Blue and Green",Song,"modal jazz"

This example uses two optional searchable-detail columns. Empty detail values are ignored. In the app, choose title as the title column and page as the page column if they are not selected automatically.

How to produce a quality mapping

For a large collection, such as a set of multi-volume music books, make and review one final PDF and CSV pair at a time. A single OCR pass is not enough: contents pages, printed page labels, and the PDF's physical page positions often disagree.

  1. Freeze the PDF first. Put every page in its final order, record the page count, and do not edit the PDF after mapping begins. For a repeatable workflow, also record its file size and SHA-256 checksum.
  2. Collect two independent title lists. Extract the table of contents or alphabetical index, then inspect the visible title and author or composer on each actual section page. Keep the physical PDF page number attached to every candidate.
  3. Reconcile page by page. Keep a working ledger with the candidate title, PDF page, whether it is a continuation, source evidence, and review status. Map only the first page of a section. Include a section found in the PDF even when the contents omitted it, and omit a contents entry that has no matching section.
  4. Use the page itself as the authority.Prefer the visible section header's spelling and punctuation. Preserve meaningful apostrophes and diacritics. Add aliases or searchable details such as composer only when the source supports them; flag uncertainty instead of guessing.
  5. Visually review the risky pages. Check every OCR disagreement, multi-page boundary, duplicate or missing candidate, and entries found by only one extraction method. Also spot-check a first, middle, last, and maximum-mapped page.
  6. Validate the finished pair. Parse the CSV again, confirm its header and row count, reject blank titles and out-of-range pages, inspect duplicates, and open several mapped results in the final PDF. If the files are uploaded or copied, read the CSV back and confirm it still matches the validated file.

If you only have printed page numbers

The app can apply one constant page offset. The resolved PDF page equals the CSV page plus the offset. For example, if printed page 1 is physical PDF page 7, use an offset of 6. Direct physical page numbers with an offset of 0 are less error-prone for generated files.

Prompt for an LLM

Copy this prompt, attach or describe the source material, and point the LLM to this page for the full contract.

Create two files for PDF Indexer from the source material I provide.

1. <name>.pdf
- Create one standard, unencrypted PDF.
- Put every page in its final reading order before making the CSV.
- Keep the document legible. Text PDFs and scanned-page PDFs are both acceptable.

2. <name>.csv
- Encode it as UTF-8, comma-delimited CSV.
- Use this header: title,page,aliases
- Add one row for each title or section that should be searchable.
- title is the display name.
- page is the title's physical page position in the final PDF, counted from 1. The first PDF page is 1 even if its printed page label is different.
- aliases is optional. Separate multiple aliases with semicolons. Quote a field when it contains a comma, quote, or line break.
- You may add named columns after aliases. PDF Indexer imports their non-empty values as searchable details.
- Keep rows in ascending page order. Different titles may share a page.

Quality requirements:
- Treat OCR and a table of contents as evidence, not final truth. When possible, compare the contents list with the visible title on each actual section page.
- Map only the first page of each section, not continuation pages.
- Include a section that is present in the PDF even if the contents omitted it. Omit a contents entry when no matching section exists in the PDF.
- Preserve meaningful punctuation, apostrophes, diacritics, and source-backed names. Do not guess uncertain titles, pages, or metadata; identify them for review.
- Visually check every disagreement or uncertain page, every multi-page boundary, and representative first, middle, last, and maximum-mapped pages.

Before returning the files, verify that every title is non-empty, every page is a positive whole number within the PDF, there are no exact duplicate title/page pairs, and the page numbers still match the final PDF. Return the two complete files. If you cannot create files, provide the complete CSV in a code block and state that limitation.

Final check