Working with a large PDF collection

Notes for document sets big enough that conversion order and corpus hygiene start to matter.

Your collection is large enough that converting it in one pass is not the right approach — and not only because of the monthly threshold. A few thousand pages of Markdown dumped into a repository will slow down search, bloat diffs, and give an agent more surface than it can use well. Below is how to work through it deliberately.

Split by how the documents are used, not by size

The instinct is to convert the biggest documents first. That is usually backwards. A 400-page hardware datasheet you consult twice a year is worth less as repository context than a 30-page API spec you reference weekly.

Order the subtrees by reference frequency:

docs/api/          → high, convert first
docs/architecture/ → high
docs/vendor/       → low, convert last or never
archive/           → probably never

Run the command per subtree. The index merges across runs, so partial conversion is a normal state, not a broken one. Rescanning one subtree does not disturb entries recorded from another.

Audit for unusable documents early

In a large collection, some documents will have no usable text layer. This matters more than it sounds: an agent reading the corpus cannot tell the difference between a document that says nothing relevant and a document that failed to convert. It will answer confidently from what it can see.

After the first subtree, open pdf-forge-exports/INDEX.md and scan the status column:

StatusAction
no_textNo Markdown was written. OCR elsewhere, then reconvert. Until then, treat the document as absent from the corpus.
low_textMarkdown was written with a warning header, but extraction is likely partial. Spot-check before relying on it.
encryptedDecrypt first. These are silently missing otherwise.
failedRetryable on the next explicit run.

Knowing what is not in the corpus is as important as knowing what is.

Unchanged files do not cost anything

Once a document is converted, re-running the command on its folder records it as unchanged: no reconversion, no threshold usage. Only a genuinely modified source counts, and only once per revision.

So the working pattern for a large set is not one heroic run. It is a series of small runs over weeks, each one picking up whatever is new, with everything already converted staying put.

Hand-edited output is never overwritten

Editing a generated Markdown file by hand is a reasonable thing to do — fixing a mangled table, adding a note. If you do, the tool notices and will not overwrite your edit.

If the source PDF later changes as well, the new conversion is written beside your file as document.pdf-forge-new.md and the row is marked conflict. Nothing is lost and nothing accumulates: a further change to the same source replaces that one candidate rather than creating a chain of files. Resolving it is a manual merge, on your terms.

Give the agent one entry point

With a large corpus this stops being a nicety. An agent pointed at a directory of a few hundred Markdown files will explore inefficiently and burn context. Pointed at pdf-forge-exports/INDEX.md, it gets the full document list, page counts, statuses, and relative links in a single read, and can then open only what it needs.

Each generated file carries front matter naming the source PDF, so an answer stays traceable to a specific document:

---
title: "Authentication: API Reference"
source: "docs/api/authentication.pdf"
pages: 42
status: "converted"
---

Version-control the corpus with its manifest

Committing pdf-forge-exports/ turns document changes into reviewable diffs. Keep .pdf-forge-manifest.json with it — that file is what records which outputs the tool generated and from which revision. It contains no document text and no secrets.

If the corpus is cloned without the manifest, the new machine cannot prove it owns the existing output and will refuse to overwrite it. That is deliberate, but it makes the corpus effectively read-only until reconverted from scratch.