### Create and read a PDF with oxidize-pdf Source: https://oxidize-pdf-for-python.docs7.io/quickstart Creates a PDF file named hello.pdf in the working directory, reopens it, and prints the page text. Uses PDF points (72 points per inch) with the origin at the bottom left. Extraction reads a text layer; this example does not perform OCR on scanned images. ```python from oxidize_pdf import Document, Font, Page, PdfReader document = Document() page = Page.a4() page.set_font(Font.HELVETICA, 18.0) page.text_at(72.0, 750.0, "Hello from oxidize-pdf!") document.add_page(page) document.save("hello.pdf") reader = PdfReader.open("hello.pdf") for text in reader.extract_text(): print(text) ``` -------------------------------- ### Install oxidize-pdf 0.23.3 in a virtual environment Source: https://oxidize-pdf-for-python.docs7.io/quickstart Creates a Python virtual environment and installs oxidize-pdf 0.23.3. Requires CPython 3.10 or newer. ```bash python -m venv .venv # Activate .venv with the command appropriate to your shell. python -m pip install "oxidize-pdf==0.23.3" ``` -------------------------------- ### Handle oxidize-pdf errors explicitly Source: https://oxidize-pdf-for-python.docs7.io/quickstart Catches PdfIoError, PdfParseError, and PdfError when opening a PDF. Use this pattern for inputs supplied by a caller. ```python from oxidize_pdf import PdfError, PdfIoError, PdfParseError, PdfReader try: reader = PdfReader.open("missing.pdf") except PdfIoError as error: print(f"Cannot read file: {error}") except PdfParseError as error: print(f"Cannot parse PDF: {error}") except PdfError as error: print(f"PDF operation failed: {error}") ``` -------------------------------- ### Ask Context7 to resolve oxidize-pdf for Python 0.23.3 Source: https://oxidize-pdf-for-python.docs7.io/context7 Use this prompt to have Context7 fetch documentation for the oxidize-pdf Python library at version 0.23.3. Resolve the library first and verify the returned project and version before querying its documentation. ```text Use Context7 to find documentation for https://github.com/bzsanti/oxidize-python. I am using oxidize-pdf for Python 0.23.3. Show an example using the API documented for that version. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.