AI Summary

Overview

pdf-inspector is a high-performance Rust library designed for intelligent PDF analysis. It excels at rapidly classifying PDFs as text-based, scanned, image-based, or mixed, enabling smarter routing decisions in document processing pipelines. Beyond classification, it offers robust text extraction with precise positional awareness and converts content into clean, structured Markdown. The library minimizes costly OCR operations by intelligently routing only scanned or image-based pages, saving significant time and resources for text-heavy documents.

Key Features

  • Blazing-Fast Classification: Accurately identifies PDF types (TextBased, Scanned, ImageBased, Mixed) in milliseconds by analyzing content streams, providing confidence scores and per-page OCR routing recommendations.
  • Precise Text Extraction: Extracts text with detailed positional information, font details, and automatically determines the correct reading order, even for multi-column layouts.
  • Intelligent Markdown Conversion: Generates well-structured Markdown, including automatic detection and formatting of headings (H1-H4), lists, code blocks, bold/italic text, URLs, and tables.
  • Advanced Table Detection: Employs both rectangle-based and heuristic methods to accurately identify and parse complex tables, including those spanning multiple pages.
  • Selective OCR Integration: Integrates seamlessly with OCR engines (like PP-OCRv6) to process only the pages that truly require it, preserving provenance and offering fallback recommendations.
  • Native Performance: Built in Rust for maximum speed and efficiency, with bindings available for Python, Node.js, and WebAssembly for broad integration.
  • Lightweight by Default: Core extraction and classification are performed without external dependencies; OCR is an opt-in feature activated only when necessary.

Typical Use Cases

  • Smart Document Routing: Significantly reduce processing costs and latency by routing text-based PDFs directly to fast local extraction, bypassing expensive OCR services. This is ideal for large-scale document processing pipelines.
  • Content Extraction from Diverse PDFs: Reliably extract structured text and tables from a wide variety of PDF types, from research papers and reports to invoices and legal documents.
  • Local PDF Analysis: Perform classification, text extraction, and Markdown conversion directly within the browser using WebAssembly, eliminating the need for server-side round trips.
  • Automated Data Ingestion: Streamline the ingestion of data from PDFs into databases or other systems by converting them into clean, structured Markdown or JSON.
  • Benchmarking and Comparison: Offers competitive performance against other PDF parsing libraries, demonstrating superior accuracy in reading order and table extraction, making it a top choice for demanding applications.

Repository Trajectory

Trended #20 on monthly

September 3, 2026

Trended #19 on daily

September 3, 2026

Trended #11 on monthly

September 2, 2026

Trended #7 on daily

September 2, 2026

Trended #5 on monthly

September 1, 2026

⋮

2 more trending entries

First tracked on GitTrend

August 31, 2026

Loading README...

Contributors

Languages

Python

2%

Rust

96%

HTML

1%

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

python

rust

pdf-parser

text-extraction

Contributors

Languages

Python

2%

Rust

96%

HTML

1%