pdf-inspector

(★ 16,426)

Fast Rust library for PDF inspection, classification, and text extraction. Intelligently detects scanned vs text-based PDFs to enable smart routing decisions.

File Explorer

  • .gitattributes
  • .gitignore
  • AGENTS.md
  • Cargo.toml
  • CLAUDE.md
  • LICENSE
  • pdf_inspector.pyi
  • pyproject.toml
  • README.md
  • rust-toolchain.toml
  • SECURITY.md

# Installation Guide

rust

Setup 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.

Enabling OCR features requires setting PDFIUM_LIB_PATH and ORT_DYLIB_PATH environment variables.

# Use via CDN

jsDelivr

jsDelivr 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 ▼

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 ▼

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 ▼

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 ▼

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 ▼

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:

# Project Badges

// repository documentation