PDF structure,built for speed.

firecrawl.github.io · 2026-08-04 · by Long Nguyen ·generic
A fast, open-source PDF parser for structured Markdown extraction, available through npm, PyPI, crates.io, and the command line.

PDF structure,built for speed.

Firecrawl open source · MIT

_RS_Rust core

PDF structure,

built for speed.

A Rust-powered, open-source parser that classifies PDFs and turns native text into clean, position-aware Markdown. Use it from Node.js or the bundled CLI, with packages also available from PyPI and crates.io.

View on GitHub ↗ Try it locally ↓ Read the docs →

npm CLI · local

$ npm i -g @firecrawl/pdf-inspector installed the native package + CLI

$ pdf-inspector annual-report.pdf

Annual report 2025

Financial highlights

| Metric | 2025 | 2024 | |---|---:|---:|

document typeTextBased outputstructured Markdown engineRust

npm npmNode.js + CLI ↗ npm i @firecrawl/pdf-inspector Py PyPIPython ↗ pip install pdf-inspector Cr crates.ioRust ↗ cargo add pdf-inspector

\[ 01 / 05 \]Browser demo

Try it in

your browser.

Drop in a native-text PDF to classify it and turn it into Markdown. The Rust core runs locally as WebAssembly in a background worker—your document never leaves this tab.

Rust core · WebAssemblyLoads on first run ◇PDF bytes stay in your browser

PDF Drop a PDF here Native-text documents · up to 25 MB Choose PDF

Remove

Select a PDF to begin.

MARKDOWN OUTPUTCopy Markdown

\_ Your parsed Markdown will appear here.

Document type—

Pages—

Processing—

\[ 02 / 05 \]Core capabilities

A focused PDF

toolchain.

Detection, extraction, layout analysis, and Markdown conversion live in one compact project. The document is parsed once and shared across stages, keeping the pipeline fast and easy to embed.

01detector.rs

Document classification

Identify TextBased, Scanned, ImageBased, or Mixed PDFs, with confidence scores and per-page signals for downstream routing.

02layout.rs

Reading order

Reconstruct multi-column and newspaper layouts from positioned text while preserving logical flow across the page.

03tables/

Table structure

Combine rectangle, line-grid, and alignment heuristics to recover cells, financial tables, and continuations across pages.

04tounicode.rs

Font decoding

Decode CID and Type0 fonts through ToUnicode CMaps, with fallbacks for common embedded font and character encodings.

05markdown/

Semantic Markdown

Emit headings, lists, tables, links, code, emphasis, captions, page markers, and token-efficient cleanup.

06napi/

Packaged for your stack

Install from npm, PyPI, or crates.io. The npm package also includes TypeScript definitions and the bundled pdf-inspector CLI.

\[ 03 / 05 \]Architecture

One parse.

Clear stages.

The pipeline keeps raw PDF concerns separate from layout and semantic conversion. Each stage has a narrow job, and the modules map directly to the repository structure.

PROCESS\_PDF()src/

INPUT

PDF bytes

Loaded once from path or memory

detectorPDF type + confidence

extractorText, fonts, rects, links

layoutLines, columns, order

tablesRows, columns, cells

markdown/convert.rs

Structured output

Clean Markdown plus classification and extraction metadata.

Call `processPdf` from Node.js, `process_pdf` from Python or Rust, or run the bundled `pdf-inspector` CLI. Every interface uses the same Rust pipeline.

\[ 04 / 05 \]Benchmark

Measured on

real documents.

Evaluated on the opendataloader-bench corpus of 200 PDFs. This comparison covers local engines without model-based PDF parsing, with OCR disabled. Higher scores are better.

200 PDFs · OpenDataLoader benchmarkApple M4 Pro · median of 3 runs

| Engine | Overall | Reading order | Tables | Headings | Complete run | | -------------- | ------- | ------------- | ------ | -------- | ------------ | | pdf-inspector | 0.875 | 0.915 | 0.814 | 0.788 | 2.8s | | LiteParse | 0.870 | 0.908 | 0.693 | 0.811 | 13.9s | | OpenDataLoader | 0.843 | 0.912 | 0.489 | 0.760 | 9.8s | | PyMuPDF4LLM | 0.735 | 0.886 | 0.401 | 0.424 | 15.5s | | MarkItDown | 0.583 | 0.879 | 0.000 | 0.000 | 6.7s |

Refreshed July 16, 2026. Scores use the benchmark’s NID, TEDS, and MHS evaluators.

Best fit

Native-text PDFs where speed, reading order, and table structure matter. pdf-inspector delivered the highest overall, reading-order, and table scores, along with the fastest complete run in this benchmark. That makes it a strong local default for reports, research papers, financial documents, invoices, and legal PDFs that need clean, structured Markdown without adding OCR latency or infrastructure.

\[ 05 / 05 \]Usage

Start with Node.

Use the CLI.

Import the native Node.js API in application code or use the bundled pdf-inspector command for scripts and shell pipelines. Python and Rust packages expose the same processing core.

Node.js CLI Python Rust

// npm i @firecrawl/pdf-inspector import { readFileSync } from 'node:fs'; import { processPdf } from '@firecrawl/pdf-inspector';

const result = processPdf( readFileSync('document.pdf') );

console.log(result.pdfType); console.log(result.markdown);

// Full Node.js API reference ↗

run directly from npm

npx @firecrawl/pdf-inspector document.pdf

or install the bundled CLI globally

npm install -g @firecrawl/pdf-inspector pdf-inspector document.pdf

structured pipeline output

pdf-inspector document.pdf --json

classification only

pdf-inspector detect document.pdf --json

Node.js and CLI reference ↗

pip install pdf-inspector

import pdf_inspector

result = pdf_inspector.process_pdf("document.pdf")

print(result.pdf_type) print(result.markdown) print(result.pages_needing_ocr)

Full Python API reference ↗

// cargo add pdf-inspector use pdf_inspector::process_pdf;

let result = process_pdf("document.pdf")?; println!("Type: {:?}", result.pdf_type);

if let Some(markdown) = &result.markdown { println!("{}", markdown); }

// Full Rust API reference ↗

firecrawl.github.io · 2 images · 10 links

Comments (0)

No comments yet