pdf-inspector is a fast Rust library for classifying PDFs and extracting structured text and Markdown locally, with bindings for Python, Node.js, browser WebAssembly, and Rust.
pdf-inspector is a Rust library focused on PDF inspection, classification, and text extraction. It can tell whether a document is text-based, scanned, image-based, or mixed, then return extracted text and Markdown when text can be recovered locally. The project also exposes the same core capability through Python, Node.js, browser WebAssembly, and a CLI.
Many PDF workflows need to know quickly whether a file can be extracted as text or needs OCR, because sending every document through OCR adds latency and cost. The repository is positioned to help route PDFs intelligently, especially for native-text documents where structured output like reading order, tables, headings, and Markdown matter. It is also meant to reduce repeated parsing work by using a single document load for both classification and extraction.
Conceptually, the library first inspects the PDF to classify it and produce a confidence score plus per-page routing guidance. If the content is text-based, it extracts text with positional information, preserves reading order across columns, and converts the result into Markdown with support for headings, lists, code blocks, tables, formatting, links, and page breaks. The README also says it can detect encoding problems and support certain font encodings, while keeping the whole approach local and free of ML models or external services.
It is drawing attention because it targets a common PDF pain point with a local, fast, developer-friendly workflow. The README highlights sub-200ms handling for text-based PDFs, broad language bindings, browser support, and a benchmark result that places it strongly for overall quality, reading order, table extraction, and speed on the evaluated corpus. Its recent benchmark refresh and clear focus on structured Markdown output make it appealing for teams building document pipelines.
The README itself compares pdf-inspector against liteparse, opendataloader, pymupdf4llm, and markitdown in its benchmark table. More generally, the alternatives implied by the project are OCR-first pipelines or other PDF parsing and extraction tools; however, the README does not provide a fuller feature-by-feature comparison beyond the benchmark results and the listed bindings. So the clearest named comparables here are the tools shown in the benchmark.
AI-explained · grounded in each repo's README