PDF to Image API — Convert PDF Pages to Images
Convert PDF document pages into image files using the PdfBroker.io API. Useful for previewing documents in a web context or showing them where a PDF reader is not available.
Endpoint
POST https://api.pdfbroker.io/api/pdf/pdftoimage
Parameters
| Parameter | Description | Default |
|---|---|---|
pageNumber |
Which page to render | 1 |
imageFormat |
image/jpeg, image/png, or image/gif |
image/png |
horizontalResolution |
DPI setting for horizontal resolution | 96 |
verticalResolution |
DPI setting for vertical resolution | 96 |
width |
Output image width (maintains proportions if height omitted) | Source width |
height |
Output image height (maintains proportions if width omitted) | Source height |
transparent |
Maintain transparent background (ineffective for JPEG) | false |
jpegQuality |
Quality range 0–100 (JPEG only) | 75 |
pngCompressionLevel |
Compression range 1–9 (PNG only) | 6 |
JSON Request Example
{
"pdfFileBase64String": "JVBERi0xLjcNCiW1tbW1...",
"options": {
"pageNumber": 1,
"imageFormat": "image/png",
"horizontalResolution": 96,
"verticalResolution": 96
}
}
Multipart/Form-Data Example
curl -X POST https://api.pdfbroker.io/api/pdf/pdftoimage \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-F "pdfdocument=@document.pdf" \
-F "options={\"pageNumber\":1,\"imageFormat\":\"image/png\"}"
Note
See the Swagger documentation for the complete API specification and all available parameters.