pdf-inspector
Fast Rust library for PDF inspection, classification, and text extraction. Intelligently detects scanned vs text-based PDFs to enable smart routing decisions.
File Explorer
- ci.yml
- pages.yml
- publish-crate.yml
- publish-pypi.yml
- publish-wasm.yml
- publish.yml
- benchmarking.md
- debugging.md
- ocr-runtime.md
- publishing.md
- python.md
- rust-api.md
- basic_usage.py
- 78-EUC-H.bcmap
- 78-EUC-V.bcmap
- 78-H.bcmap
- 78-RKSJ-H.bcmap
- 78-RKSJ-V.bcmap
- 78-V.bcmap
- 78ms-RKSJ-H.bcmap
- 78ms-RKSJ-V.bcmap
- 83pv-RKSJ-H.bcmap
- 90ms-RKSJ-H.bcmap
- 90ms-RKSJ-V.bcmap
- 90msp-RKSJ-H.bcmap
- 90msp-RKSJ-V.bcmap
- 90pv-RKSJ-H.bcmap
- 90pv-RKSJ-V.bcmap
- Add-H.bcmap
- Add-RKSJ-H.bcmap
- Add-RKSJ-V.bcmap
- Add-V.bcmap
- Adobe-CNS1-0.bcmap
- Adobe-CNS1-1.bcmap
- Adobe-CNS1-2.bcmap
- Adobe-CNS1-3.bcmap
- Adobe-CNS1-4.bcmap
- Adobe-CNS1-5.bcmap
- Adobe-CNS1-6.bcmap
- Adobe-CNS1-UCS2.bcmap
- Adobe-GB1-0.bcmap
- Adobe-GB1-1.bcmap
- Adobe-GB1-2.bcmap
- Adobe-GB1-3.bcmap
- Adobe-GB1-4.bcmap
- Adobe-GB1-5.bcmap
- Adobe-GB1-UCS2.bcmap
- Adobe-Japan1-0.bcmap
- Adobe-Japan1-1.bcmap
- Adobe-Japan1-2.bcmap
- Adobe-Japan1-3.bcmap
- Adobe-Japan1-4.bcmap
- Adobe-Japan1-5.bcmap
- Adobe-Japan1-6.bcmap
- Adobe-Japan1-UCS2.bcmap
- Adobe-Korea1-0.bcmap
- Adobe-Korea1-1.bcmap
- Adobe-Korea1-2.bcmap
- Adobe-Korea1-UCS2.bcmap
- B5-H.bcmap
- B5-V.bcmap
- B5pc-H.bcmap
- B5pc-V.bcmap
- CNS-EUC-H.bcmap
- CNS-EUC-V.bcmap
- CNS1-H.bcmap
- CNS1-V.bcmap
- CNS2-H.bcmap
- CNS2-V.bcmap
- ETen-B5-H.bcmap
- ETen-B5-V.bcmap
- ETenms-B5-H.bcmap
- ETenms-B5-V.bcmap
- ETHK-B5-H.bcmap
- ETHK-B5-V.bcmap
- EUC-H.bcmap
- EUC-V.bcmap
- Ext-H.bcmap
- Ext-RKSJ-H.bcmap
- Ext-RKSJ-V.bcmap
- Ext-V.bcmap
- GB-EUC-H.bcmap
- GB-EUC-V.bcmap
- GB-H.bcmap
- GB-V.bcmap
- GBK-EUC-H.bcmap
- GBK-EUC-V.bcmap
- GBK2K-H.bcmap
- GBK2K-V.bcmap
- GBKp-EUC-H.bcmap
- GBKp-EUC-V.bcmap
- GBpc-EUC-H.bcmap
- GBpc-EUC-V.bcmap
- GBT-EUC-H.bcmap
- GBT-EUC-V.bcmap
- GBT-H.bcmap
- GBT-V.bcmap
- GBTpc-EUC-H.bcmap
- GBTpc-EUC-V.bcmap
- H.bcmap
- Hankaku.bcmap
- Hiragana.bcmap
- HKdla-B5-H.bcmap
- HKdla-B5-V.bcmap
- HKdlb-B5-H.bcmap
- HKdlb-B5-V.bcmap
- HKgccs-B5-H.bcmap
- HKgccs-B5-V.bcmap
- HKm314-B5-H.bcmap
- HKm314-B5-V.bcmap
- HKm471-B5-H.bcmap
- HKm471-B5-V.bcmap
- HKscs-B5-H.bcmap
- HKscs-B5-V.bcmap
- Katakana.bcmap
- KSC-EUC-H.bcmap
- KSC-EUC-V.bcmap
- KSC-H.bcmap
- KSC-Johab-H.bcmap
- KSC-Johab-V.bcmap
- KSC-V.bcmap
- KSCms-UHC-H.bcmap
- KSCms-UHC-HW-H.bcmap
- KSCms-UHC-HW-V.bcmap
- KSCms-UHC-V.bcmap
- KSCpc-EUC-H.bcmap
- KSCpc-EUC-V.bcmap
- LICENSE
- NWP-H.bcmap
- NWP-V.bcmap
- RKSJ-H.bcmap
- RKSJ-V.bcmap
- Roman.bcmap
- UniCNS-UCS2-H.bcmap
- UniCNS-UCS2-V.bcmap
- UniCNS-UTF16-H.bcmap
- UniCNS-UTF16-V.bcmap
- UniCNS-UTF32-H.bcmap
- UniCNS-UTF32-V.bcmap
- UniCNS-UTF8-H.bcmap
- UniCNS-UTF8-V.bcmap
- UniGB-UCS2-H.bcmap
- UniGB-UCS2-V.bcmap
- UniGB-UTF16-H.bcmap
- UniGB-UTF16-V.bcmap
- UniGB-UTF32-H.bcmap
- UniGB-UTF32-V.bcmap
- UniGB-UTF8-H.bcmap
- UniGB-UTF8-V.bcmap
- UniJIS-UCS2-H.bcmap
- UniJIS-UCS2-HW-H.bcmap
- UniJIS-UCS2-HW-V.bcmap
- UniJIS-UCS2-V.bcmap
- UniJIS-UTF16-H.bcmap
- UniJIS-UTF16-V.bcmap
- UniJIS-UTF32-H.bcmap
- UniJIS-UTF32-V.bcmap
- UniJIS-UTF8-H.bcmap
- UniJIS-UTF8-V.bcmap
- UniJIS2004-UTF16-H.bcmap
- UniJIS2004-UTF16-V.bcmap
- UniJIS2004-UTF32-H.bcmap
- UniJIS2004-UTF32-V.bcmap
- UniJIS2004-UTF8-H.bcmap
- UniJIS2004-UTF8-V.bcmap
- UniJISPro-UCS2-HW-V.bcmap
- UniJISPro-UCS2-V.bcmap
- UniJISPro-UTF8-V.bcmap
- UniJISX0213-UTF32-H.bcmap
- UniJISX0213-UTF32-V.bcmap
- UniJISX02132004-UTF32-H.bcmap
- UniJISX02132004-UTF32-V.bcmap
- UniKS-UCS2-H.bcmap
- UniKS-UCS2-V.bcmap
- UniKS-UTF16-H.bcmap
- UniKS-UTF16-V.bcmap
- UniKS-UTF32-H.bcmap
- UniKS-UTF32-V.bcmap
- UniKS-UTF8-H.bcmap
- UniKS-UTF8-V.bcmap
- V.bcmap
- WP-Symbol.bcmap
- pdf-inspector.mjs
- lib.rs
- .gitignore
- build.rs
- bun.lock
- Cargo.lock
- Cargo.toml
- package.json
- probe-indent.mjs
- README.md
- test.mjs
- test_bench_opendataloader.py
- test_probe_backend_evidence.py
- test_version.py
- bench_opendataloader.py
- probe_backend_evidence.py
- version.py
- firecrawl-mark.svg
- firecrawl-wordmark.svg
- index.html
- detect_pdf.rs
- dump_ops.rs
- pdf2md.rs
- base14.rs
- content_decode.rs
- content_stream.rs
- fonts.rs
- layout.rs
- links.rs
- mod.rs
- reading_order.rs
- underline.rs
- xobjects.rs
- analysis.rs
- classify.rs
- convert.rs
- furniture.rs
- heading.rs
- mod.rs
- postprocess.rs
- preprocess.rs
- detect_heuristic.rs
- detect_lines.rs
- detect_rects.rs
- detect_struct.rs
- financial.rs
- format.rs
- grid.rs
- mod.rs
- structured.rs
- contracts.rs
- download.rs
- fusion.rs
- mod.rs
- models.rs
- oar.rs
- pdfium.rs
- pipeline.rs
- render.rs
- routing.rs
- adobe_korea1.rs
- detector.rs
- glyph_names.rs
- lib.rs
- process_mode.rs
- python.rs
- structure_tree.rs
- text_quality.rs
- text_utils.rs
- tounicode.rs
- types.rs
- 2013-app2.pdf
- accessory_building_permit_prose_frame.pdf
- bare_name_struct.pdf
- bits_pilani_feedback.pdf
- broken_startxref_pointer.pdf
- encrypted-secret123.pdf
- firecrawl_docs_tagged.pdf
- forecast_table_chart.pdf
- government_positions_women.pdf
- greencomp_competence.pdf
- hebrew_logical_order.pdf
- hebrew_visual_order.pdf
- multiline_indent_cell_rect_grid.pdf
- nexo-price-en.pdf
- p1244-1996.pdf
- real-estate-pricing.pdf
- scan_with_native_header_text.pdf
- shannon-entropy-p1-2.pdf
- shifted_cipher_tounicode.pdf
- shinagawa_identity_h.pdf
- td9264.pdf
- text_page_with_watermark_image.pdf
- thermo-freon12.pdf
- tnagriculture_06_12.pdf
- upstage_key_functions.pdf
- vector_outlined_text_with_caption.pdf
- wired_header_data_misalign.pdf
- wireless_dense_no_rects.pdf
- wireless_two_col_no_rects.pdf
- 2013-app2.md
- hebrew_logical_order.md
- hebrew_visual_order.md
- nexo-price-en.md
- p1244-1996.md
- real-estate-pricing.md
- shannon-entropy-p1-2.md
- td9264.md
- thermo-freon12.md
- integration_tests.rs
- local_render_tests.rs
- ocr_tests.rs
- test_python.py
- lib.rs
- Cargo.lock
- Cargo.toml
- LICENSE
- README.md
- .gitattributes
- .gitignore
- AGENTS.md
- Cargo.toml
- CLAUDE.md
- LICENSE
- pdf_inspector.pyi
- pyproject.toml
- README.md
- rust-toolchain.toml
- SECURITY.md
# Installation Guide
rustSetup Steps
cargo build --release
Build the Rust project in release mode.
cargo install pdf-inspector
Install the CLI tool and package globally.
pip install pdf-inspector
Install the Python binding package.
npm install @firecrawl/pdf-inspector
Install the Node.js package.
Key Commands
cargo build --release
Optimized build of the project's Rust source code.
cargo install pdf-inspector
Install the pdf-inspector CLI from crates.io.
pdf2md document.pdf --json
Convert a PDF file into Markdown format.
detect-pdf document.pdf --analyze --json
Detect and classify the type of a PDF document.
pip install pdf-inspector
Install the Python package via PyPI.
npm install @firecrawl/pdf-inspector
Install the Node.js package via NPM.
# Use via CDN
jsDelivrjsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.
Command Glossary
Commands referenced in this DOCs, explained below.
cargo add
View Details ▼
cargo add
Add dependencies to a Rust project's `Cargo.toml` manifest.
cargo add {{dependency}}
Add the latest version of a dependency to the current project:
cargo add {{dependency}}@{{version}}
Add a specific version of a dependency:
cargo add {{dependency}} {{[-F|--features]}} {{feature_1,feature_2,...}}
Add a dependency and enable one or more specific features:
cargo install
View Details ▼
cargo install
Build and install a Rust binary.
cargo install {{package}}@{{version}}
Install a package from <https://crates.io> (the version is optional - latest by default):
cargo install --git {{repo_url}}
Install a package from the specified Git repository:
cargo install --git {{repo_url}} --{{branch|tag|rev}} {{branch_name|tag|commit_hash}}
Build from the specified branch/tag/commit when installing from a Git repository:
cargo run
View Details ▼
cargo run
Run the current Cargo package.
Note: The working directory of the executed binary will be set to the current working directory.
cargo {{[r|run]}}
Run the default binary target:
cargo {{[r|run]}} --bin {{name}}
Run the specified binary:
cargo {{[r|run]}} --example {{name}}
Run the specified example:
npm install
View Details ▼
npm install
Install Node packages.
npm {{[i|install]}}
Install dependencies listed in `package.json`:
npm {{[i|install]}} {{package_name}}@{{version}}
Download a specific version of a package and add it to the list of dependencies in `package.json`:
npm {{[i|install]}} {{package_name}} {{[-D|--save-dev]}}
Download the latest version of a package and add it to the list of dev dependencies in `package.json`:
pip install
View Details ▼
pip install
Install Python packages.
pip install {{package1 package2 ...}}
Install one or more packages:
pip install {{package1 package2 ...}} {{[-U|--upgrade]}}
Upgrade all specified packages to the latest version, installing any that are not already present:
pip install {{package}}=={{version}}
Install a specific version of a package:
