explaingit

firecrawl/pdf-inspector

Analysis updated 2026-08-13

15,224RustAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A fast Rust library that classifies PDFs as text-based or scanned, then extracts text and converts native PDFs to clean Markdown without OCR.

Mindmap

mindmap
  root((repo))
    What it does
      Classifies PDF type
      Extracts positioned text
      Converts to clean Markdown
    Tech stack
      Rust
      Python bindings
      Node.js bindings
      WebAssembly
    Use cases
      Skip OCR for text PDFs
      Extract tables from reports
      Route scanned PDFs to OCR
    Audience
      Developers
      Vibe coders
    Setup
      Install via pip npm or cargo
      CLI tools included

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Detect whether a PDF is text based or scanned before deciding whether to run OCR on it

USE CASE 2

Convert native text PDFs, like reports or invoices, into clean structured Markdown quickly

USE CASE 3

Extract tables and reading order from financial or research PDFs

USE CASE 4

Run PDF classification and extraction entirely locally in a browser using WebAssembly

What is it built with?

RustPythonNode.jsWebAssembly

How does it compare?

firecrawl/pdf-inspectorcanner/wrenaiquickwit-oss/tantivy
Stars15,22415,19415,180
LanguageRustRustRust
Setup difficultyeasymoderatemoderate
Complexity2/54/54/5
Audiencedeveloperdatadeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice, under the MIT license.

In plain English

pdf-inspector is a Rust library built by Firecrawl that looks at a PDF file and figures out what kind of PDF it is before deciding what to do with it. It can tell whether a document is text based, scanned as an image, a mix of both, or image based, and it does this classification in about ten to fifty milliseconds by sampling the file's content rather than reading the whole thing. The point of doing this first is that a large share of PDFs, the README estimates around 54 percent, already contain real selectable text and do not need slow, expensive OCR processing at all, so those can be handled locally in under 200 milliseconds instead. For PDFs that are text based, the library extracts the text along with its position on the page, font information, and reading order, including handling multi column layouts the way a newspaper is laid out, and then converts all of that into clean Markdown. This includes recognizing headings by font size, bullet and numbered lists, code blocks, tables built either from the PDF's own drawing instructions or inferred from how text lines up, bold and italic formatting, and links. If it detects a broken or unusual font encoding it cannot reliably decode, it flags this so a calling application knows to fall back to OCR instead of producing garbled text. The library is written in pure Rust with no machine learning models and only a single external dependency for PDF parsing, and it ships bindings for Python, Node.js, and the browser through WebAssembly, plus a set of command line tools for converting PDFs to Markdown or running detection only. The README includes a benchmark against several other PDF parsing tools on a shared 200 document test set, where pdf-inspector reports the best overall score, the best reading order accuracy, the best table extraction accuracy, and the fastest total processing time among the local, non machine learning engines compared. It is intended as a strong default for reports, research papers, financial documents, invoices, and legal PDFs that need clean structured Markdown without the latency or infrastructure cost of running OCR. The project is released under the MIT license.

Copy-paste prompts

Prompt 1
Install pdf-inspector and show me how to detect whether a PDF is text based or scanned
Prompt 2
Convert this PDF report into clean Markdown using pdf-inspector's CLI
Prompt 3
Show me how to call pdf-inspector from Python to extract tables from a financial PDF
Prompt 4
Explain how pdf-inspector decides when a PDF needs OCR instead of direct extraction

Frequently asked questions

What is pdf-inspector?

A fast Rust library that classifies PDFs as text-based or scanned, then extracts text and converts native PDFs to clean Markdown without OCR.

What language is pdf-inspector written in?

Mainly Rust. The stack also includes Rust, Python, Node.js.

What license does pdf-inspector use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice, under the MIT license.

How hard is pdf-inspector to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is pdf-inspector for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.