Skip to main content

Use CPython 3.10 or newer in a virtual environment:

Save the following as hello.py. It creates a PDF in the working directory, reopens it and prints the page text.

Run python hello.py. The output should contain Hello from oxidize-pdf!.

Coordinates use PDF points (72 points per inch), with the origin at the bottom left for this page. Extraction reads a text layer; this example does not perform OCR on scanned images.

For inputs supplied by a caller, handle the package’s errors explicitly: