GitHub - firecrawl/pdf-inspector: Fast Rust library for PDF inspection, classification, and text extraction. Intelligently detects scanned vs text-based PDFs to enable smart routing decisions.
pdf-inspector is a fast Rust library for PDF classification and text extraction, available as a crate and with bindings for Python, Node.js, and browser WebAssembly. It detects whether a PDF is text-based, scanned, image-based, or mixed in 10–50ms by sampling content streams, then extracts text with position awareness and converts it to clean Markdown — all without OCR or ML models. Key features include multi-column layout detection, dual-mode table detection (rectangle-based and heuristic), CID font support, and per-page OCR routing. Benchmarked against 200 PDFs, it outperforms pymupdf4llm, markitdown, and opendataloader on overall score, reading order, and table structure, while being the fastest at 0.47s for the full corpus. Built by Firecrawl to skip expensive OCR for the ~54% of PDFs that are already text-based.