Use Rust 1.88 or newer. In a Cargo binary project, add:
Save the following as src/main.rs. It creates a one-page PDF in the working directory, reopens it and prints its text.
Run cargo run. The output should contain Hello from oxidize-pdf!.
Coordinates are measured in PDF points (72 points per inch), with the origin at the bottom left for this page. Errors from writing, opening or parsing propagate from main through ?.
Text extraction reads text represented in the PDF. A scanned image without a text layer needs OCR; this example does not perform OCR.