Use a synthetic document first
The repository includes a three-page synthetic statement. Its pages use 612 × 792 PDF points. One point is 1/72 inch, so at 144 DPI the unrotated page should render at 1224 × 1584 pixels. This gives you a predictable check before processing a real document.
Clone the repository and use a project-local environment for the pinned renderer dependencies. On Windows PowerShell:
git clone https://github.com/faigvain-ang/pdf-page-images.git
cd pdf-page-images
python -m venv .venv
.venv\Scripts\python.exe -m pip install -r requirements.txt
.venv\Scripts\python.exe pdf_page_images.py examples/statement.pdf --pages 1,3 --dpi 144 --format png --output-dir outOn macOS/Linux, the environment interpreter is .venv/bin/python. Installing dependencies downloads packages; rendering itself is local. See the README for the pinned PDFium and Pillow versions and their licenses.
Check page identity and dimensions
The output names are statement-page-001.png and statement-page-003.png. The second image is original page 3, not a newly renumbered page 2. The visible synthetic page labels let you check that mapping. At 144 DPI the sample's first page is 1224 × 1584. Its third page deliberately has a 90-degree display rotation, so that output is 1584 × 1224.
Page selection counts PDF pages from 1. It does not interpret printed labels such as Roman numeral “iii” or an appendix's “A-1”. Use a comma list or range such as 1,3 or 1-3. An out-of-range page is an error, not a silent omission.
Choose the actual delivery format
For JPEG use --format jpeg. Review small lettering at the target display size. The output is a raster copy, not editable text, OCR or a signature-preserving document. The source PDF is not modified.
For a broader local-first editing and annotation workflow, the related product is KomoPDF. This command-line tool only renders images.
← Field notes