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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"outputDir": "<outputDir>"
},
"name": "to_images"
}
}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. |