AI Summary

Overview

pdf-inspector is a high-performance Rust library designed for efficient PDF analysis. It excels at classifying PDFs into types like Text-Based, Scanned, Image-Based, or Mixed, and can extract text with remarkable accuracy. A standout feature is its ability to intelligently detect scanned versus text-based documents, enabling smart routing decisions in processing pipelines and significantly reducing the need for expensive OCR services for PDFs that don't require it. With bindings for Python, Node.js, and WebAssembly, it offers a versatile solution for local PDF processing.

Key Features

  • Intelligent PDF Classification: Quickly determines PDF type (TextBased, Scanned, ImageBased, Mixed) with confidence scores and per-page OCR routing suggestions, all in milliseconds.
  • Accurate Text Extraction: Extracts text while preserving positional awareness, font information, and automatically determining reading order for multi-column layouts.
  • Rich Markdown Conversion: Transforms PDF content into clean Markdown, intelligently identifying headings (H1-H4), lists, code blocks, tables, bold/italic formatting, and links.
  • Advanced Table Detection: Features dual-mode table detection, combining rectangle-based analysis of drawing operations with heuristic detection from text alignment, capable of handling complex financial tables and multi-page continuations.
  • Broad Encoding Support: Decodes common CID font encodings, including ToUnicode CMap, ensuring accurate text retrieval across a wide range of PDFs.
  • Optimized for Speed & Efficiency: Built in pure Rust, it offers exceptional performance, processing text-based PDFs locally in under 200ms without external dependencies or ML models.
  • Browser & Serverless Ready: With WebAssembly support, it can run directly in the browser or in serverless environments, eliminating the need for server round trips.

Typical Use Cases

pdf-inspector is ideal for applications requiring efficient and intelligent PDF processing at scale. Its primary use case is in smart PDF routing pipelines, where the ability to quickly distinguish between text-based and scanned documents allows for significant cost and latency savings by selectively applying OCR only when necessary.

This makes it a powerful tool for:

  • Document Processing Services: Routing documents to the appropriate processing path (e.g., local extraction vs. OCR) based on content type.
  • Data Extraction Platforms: Extracting structured data from reports, research papers, financial documents, invoices, and legal texts with high fidelity.
  • Content Management Systems: Indexing and searching PDF content efficiently by converting them to structured Markdown.
  • Local PDF Analysis: Enabling users to analyze and convert PDFs directly in the browser or via lightweight command-line tools without relying on server-side infrastructure.

Repository Trajectory

Trended #20 on monthly

September 2, 2026

Trended #18 on daily

September 2, 2026

Trended #11 on monthly

September 1, 2026

Trended #8 on daily

September 1, 2026

Trended #5 on monthly

August 31, 2026

⋮

11 more trending entries

First tracked on GitTrend

August 3, 2026

Loading README...

Contributors

Languages

Rust

96%

Python

2%

HTML

2%

About

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

Related Blogs

Topics

markdown

nodejs

ocr-routing

pdf

pdf-classification

pdf-extraction

pdf-parser

python

rust

text-extraction

Contributors

Languages

Rust

96%

Python

2%

HTML

2%