Skip to content

The pages read back as a document: pdf-to-markdown and prepare-pdf-for-ai - #111

Merged
tannevaled merged 1 commit into
mainfrom
the-pages-read-back-as-a-document
Oct 12, 2026
Merged

tannevaled merged 1 commit into
mainfrom
the-pages-read-back-as-a-document

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor
covered       86
not covered   28
parity       75.4% (86/114), every claim verified

Claimed through pdfops markdown in
go-pdfkit/ops v0.18.0 over
go-pdfkit/document v0.1.0, a new
repository.

One verb for both, because they are the same thing twice over

BentoPDF's prepare-pdf-for-ai is per-page Markdown with the document's
metadata beside it — that is what PyMuPDF4LLM's LlamaMarkdownReader produces
— which is pdfops markdown -json. pdf-to-markdown is the same reading
written out as one document.

⛔ What is claimed is the inference, not a conversion

A PDF has no headings. It has instructions for drawing glyphs at places, and
everything above that is a judgement. go-pdfkit/document publishes which
judgements it makes and which it refuses — ruled lines and multi-column
layouts are not read
— and that bound is in its README rather than buried.

The rule for a heading was measured rather than guessed: over six real
documents, the share of characters at each size above that document's body
size separates heading sizes (0.01%–5.76%) from second body sizes
(32.6%–39.4%). Taking "larger than the body" alone gave a 9-page report 131
headings, 130 of which were paragraphs
.

🤖 Generated with Claude Code

…r-ai

parity 75.4% (86/114), pasted from the tool's own output.

One verb for both, because they are the same thing twice over: BentoPDF's
prepare-pdf-for-ai is per-page MARKDOWN with the document's metadata beside it
-- PyMuPDF4LLM's LlamaMarkdownReader -- which is `pdfops markdown -json`, and
pdf-to-markdown is the same reading written out as one document.

What is claimed is the INFERENCE, not a conversion. A PDF has no headings, and
go-pdfkit/document publishes what it will and will not see: ruled lines and
multi-column layouts are not read, and that bound is in its README rather than
buried.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit cb76d69 into main Oct 12, 2026
9 checks passed
@tannevaled
tannevaled deleted the the-pages-read-back-as-a-document branch October 12, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant