1. Products
  2.   PDF
  3.   Rust
  4.   pdf_oxide

pdf_oxide

 
 

Open Source Multi-Language PDF Library

Extract Text, Images & Markdown, Create & Edit PDFs — 0.8ms Mean, 5× Faster Than PyMuPDF, 100% Pass Rate on 3,830 PDFs.

What is pdf_oxide?

pdf_oxide is a high-performance, open-source PDF toolkit built in Rust with idiomatic bindings for 19 languages, including Python, Go, JavaScript/TypeScript, C#, Java, Kotlin, Swift, and more. It delivers exceptional speed (0.8ms mean per document), reliability (100% pass rate on 3,830 real-world PDFs), and a complete feature set for text extraction, image extraction, form handling, and markdown conversion. Designed for production use in RAG pipelines, AI assistants, and large-scale document processing, pdf_oxide avoids the licensing restrictions of AGPL alternatives while maintaining superior accuracy and throughput across all platforms.

At its core, pdf_oxide leverages a stable Rust implementation with thin, language-native wrappers that ensure consistent behavior and bug fixes across all supported ecosystems. Whether you're building a Python-based RAG engine, a Node.js CLI tool, or a .NET desktop application, pdf_oxide provides a unified, high-fidelity PDF processing experience. Its permissive MIT/Apache-2.0 license allows unrestricted use in commercial and open-source projects, making it the ideal replacement for PyMuPDF, pypdf, pdfplumber, and other slower or more restrictive libraries.

Previous Next

Getting Started with pdf_oxide

Install pdf_oxide via pip for Python or add it to your Cargo.toml for Rust. The library is available on PyPI, Crates.io, npm, and other package registries for all supported languages. For Python, use `pip install pdf_oxide` — wheels are provided for Linux, macOS, and Windows (Python 3.8–3.14). For Rust, add `pdf_oxide = "0.3"` to your dependencies. The project is hosted on [pdf_oxide](https://github.com/yfedoseev/pdf_oxide), where you’ll find CLI tools, MCP server, and full documentation. With zero panics and 100% pass rate on 3,830 PDFs, it’s ready for production use.

Install pdf_oxide via PIP and Cargo

# Python
pip install pdf_oxide

# Rust (Cargo.toml)
[dependencies]
pdf_oxide = "0.3"

Text & Layout Extraction

pdf_oxide delivers lightning-fast, high-fidelity text extraction with character-level precision, word detection, line segmentation, and table identification. Its adaptive layout analysis automatically detects headings, paragraphs, and spacing, while extraction profiles let you tune behavior for forms, academic papers, or general documents. The API supports lazy loading for memory efficiency and region-based extraction for targeted processing. With 99.5% text parity against PyMuPDF and pypdfium2 across 3,830 PDFs, it extracts text from 7–10× more "hard" files than competitors — ideal for RAG pipelines, document indexing, and data extraction workflows.

Extract Text, Words, and Markdown via Python API

from pdf_oxide import PdfDocument

with PdfDocument("paper.pdf") as doc:
    for page in doc:
        text = page.text                      # lazy text extraction
        chars = page.chars                    # character-level data
        words = page.words                    # detected word objects
        md = page.markdown(detect_headings=True)  # structured markdown

Image & Form Extraction

Extract images, vector graphics, and form fields with full fidelity using pdf_oxide’s unified API. The library identifies embedded images (including JPEG, PNG, and TIFF) and preserves their metadata, while form field extraction supports text, checkboxes, radio buttons, and dropdowns — with optional field population and saving. This makes pdf_oxide ideal for invoice processing, data entry automation, and archival digitization. Combined with region-based extraction, you can isolate specific form zones or image regions for targeted processing, ensuring accurate and reproducible results at scale.

Extract Images and Fill Form Fields via Python

from pdf_oxide import PdfDocument

with PdfDocument("form.pdf") as doc:
    # Extract images from first page
    images = doc[0].images
    
    # Extract and fill form fields
    fields = doc.get_form_fields()
    doc.set_form_field_value("employee_name", "Jane Doe")
    doc.set_form_field_value("wages", "85000.00")
    doc.save("filled.pdf")

CLI & MCP Server for AI Assistants

pdf_oxide ships with a powerful CLI for terminal-based PDF processing and an MCP server for seamless integration with AI assistants like Claude and Cursor. The CLI supports 22 commands — from text and markdown extraction to merging, splitting, searching, and watermarking — with options for page ranges, JSON output, and interactive REPL mode. The MCP server exposes local PDF extraction via the Model Context Protocol, enabling AI tools to read and process documents without sending data to the cloud. Perfect for privacy-first RAG, local document analysis, and developer tooling.

Use CLI Commands and MCP Server for PDF Processing

# Extract text and convert to Markdown
pdf-oxide text document.pdf
pdf-oxide markdown document.pdf -o output.md

# Search with regex and extract images
pdf-oxide search document.pdf "neural.?network"
pdf-oxide images document.pdf -o ./images/

# MCP server (configured in Claude Desktop / Cursor)
# { "mcpServers": { "pdf-oxide": { "command": "crgx", "args": ["pdf_oxide_mcp@latest"] } } }

Performance & Reliability

Benchmarked on 3,830 real-world PDFs from veraPDF, Mozilla pdf.js, and DARPA SafeDocs, pdf_oxide achieves a 0.8ms mean extraction time — 5× faster than PyMuPDF, 15× faster than pypdf, and 29× faster than pdfplumber — with 100% pass rate and zero panics. Its Rust core ensures memory safety and consistent behavior across all 20 language bindings, while adaptive layout analysis and robust parsing handle edge cases that break other libraries. This reliability makes it the preferred choice for production RAG engines, AI agents, and large-scale document processing pipelines where speed, accuracy, and uptime are critical.

Performance Comparison (Python Libraries)

Library         Mean   p99   Pass Rate  License
pdf_oxide       0.8ms  9ms   100%       MIT
PyMuPDF         4.6ms  28ms  99.3%      AGPL-3.0
pypdfium2       4.1ms  42ms  99.2%      Apache-2.0
pdfplumber     23.2ms 189ms  98.8%      MIT
pypdf          12.1ms  97ms  98.4%      BSD-3
 English