MediumA PDF Parser from the 80s Beats Claude (And They Use It Internally) | by Fayner Brack | MediumSitemapOpen in appSign up<br>Sign in
Medium Logo
Get app<br>Write
Search
Sign up<br>Sign in
A PDF Parser from the 80s Beats Claude (And They Use It Internally)
My journey to parse a CIA PDF, only to discover picking the right tool for the job is still a thing
Fayner Brack
8 min read·<br>Jun 1, 2026
Listen
Share
A warm-toned illustration of an 1980s scanner feeding a page through and emitting clean lines of characters, with a switched-off chrome sphere sitting small and dim in the corner.
Want to come back later? Save this to readplace.com.<br>A PDF Parser from the 80s Beats Claude (And They Use It Internally) | Reader View<br>Tesseract, an OCR tool from 1985, outperforms modern AI models for PDF parsing and is used internally by Claude.
readplace.com
When you give a PDF to an AI, you picture the model reading it. However, for certain kinds of PDFs, the actual model barely sees the text, they only call tools previously dictated by their actual software engineers.<br>I spent days trying to parse a badly scanned CIA PDF (don't ask me why, otherwise I'll have to kill you). I tried using the most powerful Anthropic and Google models but I ended up concluding Tesseract (a 1985 tool), does a better job and much faster by 10x.<br>Not just that, but I found out that Claude uses PyTesseract in their PDF parser skill under the hood. They pick that by going through a heuristic, rasterising the most difficult scanned pages and completing missing sentences with hallucinated words when streaming their tokens back.<br>Claude Code AI model is not better than anyone else, they just pay skilled engineers to give them the right tools to call.
Claude ships with skills, small Markdown instruction files that tell it how to handle a task. Anthropic published the format and a set of these skills in the open, so you can read them. The reading strategy part is (apparently) not open source and reads like a runbook that a tired engineer wrote at 2am.<br>### Choosing your reading strategy
**Text-heavy documents** (reports, articles, books):<br>→ Text extraction is primary. Rasterize only for specific figures or<br>pages where layout matters.
**Scanned documents** (`pdffonts` shows no fonts):<br>→ `pdftotext` will return nothing - don't run it. Rasterize pages at<br>150 DPI and Read them visually. For bulk text extraction, use OCR<br>(pytesseract after converting pages to images - see REFERENCE.md for<br>a complete example).
**Slide-deck PDFs** (exported presentations):<br>→ Every page is primarily visual. Rasterize individual pages on demand.<br>Text extraction gives you bullet-point text but loses all layout.
**Form-heavy documents**:<br>→ Extract form field values programmatically first (see below). Rasterize<br>the form page for visual context if needed.
**Data-heavy documents** (tables, charts, figures):<br>→ Use pdfplumber for tables. Rasterize pages with charts/figures.<br>Extract text for surrounding narrative. Consider both text AND image<br>for the same page when precision matters.For a PDF, the first move is not the model. It is a diagnostic. The skill runs pdffonts and checks whether the file carries a text layer. Two cases follow, and they get different tools.<br>A born-digital PDF holds its text inside it. pdftotext pulls that text out in milliseconds, with no model involved. The characters were sitting there the whole time.<br>A scanned PDF is pixels. A photocopier flattened the words into an image, and there is nothing to pull out. Here the skill reaches for OCR, and the tool it names is pytesseract.<br>pytesseract is the Python binding to Tesseract. HP Labs started Tesseract in 1985. HP open-sourced it in 2005, and Google kept it going after that. The engine is older than most of the people shipping AI products today.<br># render every page to a PNG at 300 DPI (I tried 150dpi, shittier results)<br>pdftoppm -r 300 -png input.pdf page
# OCR one page BAM!<br>tesseract --psm 1 --oem 1 -l eng page-01.png ---psm 1 runs orientation and script detection before recognition. --oem 1 selects the LSTM engine. It needs no API key and makes no network call, so there is no rate limit to negotiate to access a walled garden.<br>This is the part that matters. The skill could have told the model to look at each page and read it off. The model can do that. A scanned page is an image, and the model can describe an image.<br>Reading clean letters off a page is an old, settled problem. Tesseract handled a version of it decades ago. It is fast, it runs locally, and it costs nothing to call. It returns the same text on every run but some garbage here and then.<br>A model pointed at the same page is slower, burns tokens ($$), needs a network round trip, and can quietly invent words that were not there. So a careful engineer reaches for the narrow tool. The skill makes the same call.<br>Claude is not the thing reading your scan. A character engine from the 1980s is.
The model does get pointed at a page sometimes, when layout...