Turn PDF pages into images
POST/pdf/to-image
Draws pages of a PDF as PNG or JPEG pictures: thumbnails, previews, pictures for a page or a
chat. One page answers a render whose output is the picture (contract-1.png), several a ZIP
of them, named by page. Without pages every page is drawn. One call draws at most 100 pages
and 120 million pixels, about 55 A4 pages at 150 dpi or 13 at 300 dpi (422
page_limit_exceeded above). Fonts a PDF does not embed are drawn with the converter's fonts.
The source is a stored PDF named as source in a JSON body, or an upload as
multipart/form-data with the PDF as file (never stored). Costs one unit per picture on
live keys, as an image render does; Starter plan and above. A password-protected PDF answers
422 source_encrypted. Needs render:create.
Request
Responses
- 200
- 413
- 415
- 422
- 429
- 503
- default
The render; its output is png or jpg for one page, zip for several.
The upload is larger than the plan's output size or 100 MB.
file_type_unsupported: the upload is no PDF.
source_not_found, source_invalid, source_encrypted, page_limit_exceeded (more pages or pixels than one call draws, or the plan's page limit), invalid_request for a page past the last one or too large for its dpi, output_too_large.
rate_limited: the workspace's bucket of the plan's requests per second is empty (Free test keys also have 30 a minute). The problem names the bucket's limit and its window_seconds. Retry after Retry-After seconds.
Response Headers
Seconds until a request is let through again.
Size of the workspace's request bucket: the plan's requests per second. Free test keys are also held to 30 requests a minute, and the headers then describe whichever bucket is closer to empty.
Requests left in the bucket.
Seconds until the bucket is full again.
tool_unavailable: the PDF tools are busy; retry after Retry-After seconds.
Error (RFC 9457 problem details).