PDF to Images
Converts PDF pages to images (JPEG, PNG or TIFF) and returns a ZIP archive, or a single multipage TIFF.#
/lmkit/v1/pdf-to-imagesRenders each page of a PDF as an image at the specified DPI and format. The images are packaged in a ZIP archive stored on the server. Set 'multipage' to true with format 'tiff' to pack every selected page into ONE multipage TIFF file instead, which is what archival, fax and scanner pipelines expect; the response then carries the file ID of that single .tif. Multipage TIFF holds every rendered page in memory at once, so a job combining a high DPI with a long page range can exceed the server's limit and fail: lower the DPI, narrow 'page_range', or leave 'multipage' false to get a ZIP. This is a pure document processing operation that does not require an AI model. Returns 422 Unprocessable Entity with an ErrorResponse body if the input file cannot be processed. The 'error' field contains one of: 'password_required' (encrypted PDF), 'invalid_format' (not a valid PDF), 'unsupported_security' (unsupported encryption), 'page_error' (content error).
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
inputrequired | string | The source PDF document (base64 or file identifier). |
input_format | How the input is provided. Defaults to 'Base64EncodedFile'. | |
format | Output image format: 'jpeg' (default), 'png' or 'tiff'. | |
quality | object (int32) | JPEG quality (1-100). Only applies when format is 'jpeg'. Default: 90. |
dpi | object (int32) | Render resolution in DPI. Default: 150. Range: 72-600. |
page_range | string | Optional page range (e.g. '1-3', '5', '2-'). If omitted, all pages are converted. |
unwrap_single | boolean | When true and the result contains exactly one image, the output is stored as a raw image file instead of a ZIP archive. Default: false. Ignored when 'multipage' is true, which always produces a single file. |
multipage | boolean | When true, every selected page is packed into ONE multipage TIFF file instead of a ZIP archive of per-page images. Requires format 'tiff'. Default: false. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | Accepted | |
| 422 | Unprocessable Entity | |
| 400 | Bad Request |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/pdf-to-images" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "",
"input_format": "Base64EncodedFile",
"format": "jpeg",
"quality": 90,
"dpi": 150
}'