pdf-inspector GitHub Repository - Source, Builds & Contributing
The official source code lives at github.com/firecrawl/pdf-inspector, maintained by Firecrawl under the MIT License. Whether you want to read the source, file a bug, or contribute, this is the entry point — this page rounds up the key links and local-build steps.
Key Links
| What | Where |
|---|---|
| Source repository | github.com/firecrawl/pdf-inspector |
| Issues | github.com/firecrawl/pdf-inspector/issues |
| Releases | github.com/firecrawl/pdf-inspector/releases |
| OCR runtime guide | docs/ocr-runtime.md |
| README | github.com/firecrawl/pdf-inspector#readme |
The one true repo is firecrawl/pdf-inspector; @firecrawl/pdf-inspector on npm, pdf-inspector on PyPI, and the pdf-inspector crate on crates.io are its official release channels.
Clone the Repository
git clone https://github.com/firecrawl/pdf-inspector.git
cd pdf-inspectorWhat's Inside
pdf-inspector is a Rust-first, multi-language workspace:
- Rust core — five modules: detection (
detector), extraction (extractor), layout (layout), tables (tables), and Markdown rendering (markdown/); the only PDF parsing dependency is lopdf; - Node.js binding (napi) — the
@firecrawl/pdf-inspectornpm package with prebuilt binaries for Linux / macOS / Windows, TypeScript definitions, and a CLI; - Browser binding (wasm) — the
@firecrawl/pdf-inspector-wasmnpm package, single-threaded build with embedded CMaps; it powers the online demo on this site's homepage; - Python binding — the
pdf-inspectorPyPI package, built with maturin; - CLI — the
pdf2mdanddetect-pdfbinaries shipped with the Rust crate; - Test assets — snapshot tests, mutation tests, and cargo-fuzz targets.
Architecture details are in the project introduction.
Building from Source
Rust (core + CLI)
cargo build --release # build the core library and CLI
cargo install pdf-inspector # or install pdf2md / detect-pdf onto your PATH
cargo test # run the test suiteNode.js binding
npm install @firecrawl/pdf-inspector # prebuilt binaries — no Rust toolchain neededTo modify the binding itself you'll need a Rust toolchain and the napi CLI; see the development section of the repo README.
Python binding
pip install pdf-inspector # prebuilt wheel — no Rust toolchain neededFor in-repo development:
maturin develop --releaseBrowser WASM
npm install @firecrawl/pdf-inspector-wasmThe WASM build embeds CMap data, so browsers need no extra font-mapping files.
Don't Want to Compile?
Most users never need a source build — the prebuilt packages are the everyday path; see the install page. Just want to try it? Drop a PDF into the homepage demo.
Filing a Good Issue
Three things make issues dramatically easier to triage:
- Classify first: paste the output of
detect-pdf file.pdf --analyze --json— many "garbled output" reports turn out to be scanned or encoding-corrupted pages; - Minimal reproduction: the smallest PDF that triggers the problem (redacted!) or repro steps;
- Environment: platform, package and version (
@firecrawl/pdf-inspector/pdf-inspector/ thepdf-inspectorcrate), and how you call it.
Contributing Code
- Fork the repo and branch off
main; - Include tests with your change — snapshot cases against real-world dirty PDFs are especially welcome;
- Make sure
cargo testand formatting pass, then open a PR; - For larger changes (new dependencies, new APIs, new formats), open an issue first.
Note
pdf-inspector is MIT licensed. Submitting a PR means you agree to license your contribution under the same terms.
Sister Repository: AnyDoc
Around the same time, Firecrawl also open-sourced anydoc (official site anydoc.wiki): it converts 14 office formats — Word, PPT, Excel, OpenDocument, RTF, EPUB, CSV, and more — into Markdown, with the PDF path powered by pdf-inspector itself. PDF-only? Stay here. Mixed office files? Use AnyDoc — details on the AnyDoc page.