pdf-inspector — Smart PDF Classification to Avoid Unnecessary OCR
- URL: https://www.threads.com/share/BAZ6wnaCs5/
- Date Saved: 2026-08-03
- Source: Threads (@xiaoxiunique)
- Tags: dev-tools, ai-engineering
- Repo: https://github.com/firecrawl/pdf-inspector
Summary
pdf-inspector by Firecrawl classifies PDFs as text-based vs scanned in 10-50ms, letting you skip expensive OCR for the ~54% of PDFs that already have extractable text layers. 6.8K stars (+1.8K in one day).
Problem:
Most pipelines send ALL PDFs to OCR services (charged per page), but over half already contain text layers that can be extracted directly — no OCR needed.
How it works:
- Classify PDF (text-based or scanned) in 10-50ms
- Text-based → extract locally to clean Markdown in 200ms
- Scanned → route to actual OCR service
Performance:
- 200 documents classified + extracted in 0.47s (markitdown takes 16s)
- Preserves: tables, multi-column layouts, heading hierarchy, code blocks
- Pure Rust — no ML model, no external service dependency
Bindings:
- Python
- Node.js
- Browser (WASM)
Why it matters:
Smart routing layer for any RAG/document pipeline. Classify first, only pay for OCR when genuinely needed. Could save ~50% on document processing costs for mixed PDF workloads.