PDF page → PNG
Try it interactively →POST /api/pdf-to-imageRasterize a PDF page to PNG. Configurable DPI (72 / 150 / 300 / custom). Useful for thumbnails, preview generation, and feeding PDFs into image pipelines.
Inputs
| Name | Type | Default | Description |
|---|---|---|---|
| pdf* | file | — | PDF document. |
| page | number | 1 | 1-based page index. |
| scale | number (0.5…6) | 2 | Render scale. 1.0 = 72 DPI baseline; 2.0 = 144 DPI; capped at 6. |
Response
Modes: binary, json. Cache: yes (24h TTL).
Code samples
Built from the hello-page-1 example.
# Download or substitute the example input:
# curl -O https://xtract.bot/examples/pdf-to-image/hello.pdf
PDF=$(base64 -w0 < hello.pdf)
curl -X POST https://api.xtract.bot/api/pdf-to-image \
-H "Content-Type: application/json" \
-H "Accept: application/octet-stream" \
-H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
-H "X-Api-Key: $XTRACT_API_KEY" \
-d '{
"page": 1,
"scale": 2,
"pdf": "'"$PDF"'"
}'