spectre_pdf 1.0.0

Native Rust PDF extraction engine: text, markdown for RAG, AcroForm widgets, image decoding, and encrypted PDFs. Lazy parser, persistent Document handle, no C dependencies.
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Dump spectre_pdf's extracted text for a PDF, for parity / regression
//! debugging against pymupdf / pdfminer / pdfplumber outputs.
//!
//! Run: cargo run --release --example dump -- /path/to/file.pdf

fn main() {
    let path = std::env::args().nth(1).expect("usage: dump <path.pdf>");
    let bytes = std::fs::read(&path).expect("read PDF");
    let text = spectre_pdf::extract_text_lenient(&bytes).expect("extract_text_lenient");
    print!("{text}");
}