PDFOxide
Fast PDF Toolkit for Rust and Python
Extract, create, and edit PDFs with Rust performance. Native Python bindings included.
Quick Start
Python
=
=
=
=
Rust
use PdfDocument;
let mut doc = open?;
let text = doc.extract_text?;
let images = doc.extract_images?;
let markdown = doc.to_markdown?;
[]
= "0.3"
Why pdf_oxide?
- Fast — Rust core, p50 = 0.6ms per PDF, 97.6% under 10ms
- Reliable — 100% pass rate on 3,830 test PDFs, zero panics
- Complete — Extract, create, and edit with one library
- Dual-language — First-class Rust API and Python bindings via PyO3
Features
| Extract | Create | Edit |
|---|---|---|
| Text & Layout | Documents | Annotations |
| Images | Tables | Form Fields |
| Forms | Graphics | Bookmarks |
| Annotations | Templates | Links |
| Bookmarks | Images | Content |
Python API
=
# Extract text from each page
=
# Character-level extraction with positions
=
# Password-protected PDFs
=
=
Rust API
use PdfDocument;
Performance
Verified against 3,830 PDFs from three independent test suites:
| Corpus | PDFs | Pass Rate |
|---|---|---|
| veraPDF (PDF/A compliance) | 2,907 | 100% |
| Mozilla pdf.js | 897 | 100% |
| SafeDocs (targeted edge cases) | 26 | 100% |
| Total | 3,830 | 100% |
| Metric | Result |
|---|---|
| p50 latency | 0.6ms |
| p90 latency | 3.0ms |
| p99 latency | 33ms |
| Under 10ms | 97.6% of PDFs |
| Timeouts | 0 |
| Panics | 0 |
100% pass rate on all valid PDFs. The only 7 non-passing files across the entire corpus are intentionally broken test fixtures (no PDF header, fuzz-corrupted catalogs, invalid xref streams).
Installation
Python
Wheels available for Linux, macOS, and Windows. Python 3.8–3.14.
Rust
[]
= "0.3"
Building from Source
# Clone and build
# Run tests
# Build Python bindings
Documentation
- Getting Started (Rust) - Complete Rust guide
- Getting Started (Python) - Complete Python guide
- API Docs - Full Rust API reference
- PDF Spec Reference - ISO 32000-1:2008
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
&& && &&
License
Dual-licensed under MIT or Apache-2.0 at your option.
Citation
Rust + Python | 100% pass rate on 3,830 PDFs | p50 = 0.6ms | v0.3.5