Render pages to images
to_imagesConvert PDF pages to PNG or JPG images at a specified DPI for previews, OCR, or vision model input.
Instructions
Rasterize PDF pages as PNG or JPG at a chosen DPI. Useful for previews, OCR pipelines, or feeding pages back to a vision model.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dpi | No | Render resolution. Default 150. PDF native is 72; common values: 96 screen, 150 print preview, 300 print. | |
| path | Yes | Absolute path to the source PDF. | |
| pages | No | 1-based page range, e.g. "3", "1-5", "1,3,5-7". Omit for all pages. | |
| format | No | Output format. Default "png". "jpg" is smaller but lossy. | |
| basename | No | Stem for output filenames. Default = source filename without .pdf. Final names: '<basename>-001.png' (page number padded to 3 digits). | |
| outputDir | Yes | Directory to write the rendered images into. | |
| jpgQuality | No | JPEG quality 40-100. Default 85. Ignored for PNG. |