RSS Amplifier

andrew.ooo · Aug 16, 2026

pdf-inspector Review: Skip OCR for Most of Your PDFs

0
Sign in to vote or save

This page did not load. You can still read it on the original site — the toolbar below keeps your place in the directory.

Hands-on review of Firecrawl's pdf-inspector, the MIT Rust library that classifies PDFs in ~20ms and extracts Markdown without OCR. Benchmarks and real limits.

Key highlights:

• ~15.8K GitHub stars (repo opened February 6, 2026), 1,095 forks, MIT-licensed, pure Rust

• Classifies a PDF in ~10-50ms without rendering a single page — returns `TextBased`, `Scanned`, `ImageBased`, or `Mixed` plus a confidence score and a per-page `pages_needing_ocr` list

• No ML models, no GPU, no API key, no system dependencies — one Rust dependency (`lopdf`)

• Bindings for Python, Node.js, browser WebAssembly, and Rust, plus two CLIs (`pdf2md`, `detect-pdf`)

• Benchmark headline: 0.875 overall on the 200-document opendataloader-bench corpus, and it finished the whole corpus in 0.47s versus 17.1s for PyMuPDF4LLM

What is pdf-inspector?

Firecrawl builds web-scraping and document-parsing infrastructure for AI pipelines. pdf-inspector is the piece of that stack they open-sourced: a from-scratch Rust PDF engine that reads a document's internal structure — font encodings, text operators, image coverage — rather than rendering it to pixels and looking at it.

That distinction is the whole product. A conventional "PDF to Markdown for RAG" tool tends to assume the worst: a page might be a scan, so send it to OCR or a vision model and let the GPU sort it out. Firecrawl's stated figure is that roughly 54% of PDFs don't need OCR at all — reports, research papers, invoices, contracts, and legal filings are usually generated by software and carry a perfectly good text layer inside them.

pdf-inspector's job is to find that out in milliseconds and, if the text is there, pull it out locally in about 150ms. Firecrawl says this routing layer is what makes their hosted Fire-PDF engine 3.5x to 5x faster than their previous pipeline: on a 200-page report where 150 pages are pure text, 150 pages never touch a GPU.

How the classifier actually works

This is the part worth understanding, because it explains both the speed and the failure modes.

Detection does not load the full document. The steps are:

1. Parse the xref table and page tree — no full object load

Real code: three languages, one call

The API surface is deliberately tiny. Python, via maturin:

print(result.pdf_type) # "text_based", "scanned", "image_based", "mixed"

import { processPdf, classifyPdf } from '@firecrawl/pdf-inspector';


Read the Full Deep Dive

This is a condensed version. The full article includes architecture diagrams, code examples, comparison tables, and practical use cases.

👉 Read the complete analysis on andrew.ooo

Topics: pdf parsing, rust, firecrawl, pdf-inspector, rag

Read on andrewdotooo.substack.com

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.