PDF to Image
Convert PDF pages to high-quality PNG or JPEG images.
https://api.morphopdf.com/v1/convert/pdf-to-imageAuthentication
Retrieve your API Key from Dashboard.
Request Body
Provide the PDF file.
fileFilePDF file uploaded via multipart/form-data.
urlstringOptionalPublic URL pointing to a PDF file.
Query Parameters
formatstringOptionalDefault: jsonResponse format. Use 'binary' to receive the image(s) directly.
imageFormatstringOptionalDefault: pngOutput image format. Options: 'png', 'jpg', 'jpeg'.
dpinumberOptional72-600Default: 150Image resolution in DPI. Options: 72, 96, 150, 300, 600.
qualitynumberOptional1-100Default: 85JPEG quality (1-100). Only applies to jpg/jpeg format.
pageRangestringOptionalSpecific pages to convert. Examples: '1', '1-5', '1,3,5'.
Response
When using format=json (default):
successbooleanIndicates whether the operation completed successfully.
messagestringHuman-readable status message.
fileNamestringName of the generated file (ZIP or single image).
downloadUrlstringPresigned URL to download the file. Valid for 1 hour.
pageCountnumberNumber of pages converted.
Output Format
Single-page PDF: Returns the image directly (PNG or JPEG).
Multi-page PDF: Returns a ZIP archive containing all page images.
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | INVALID_INPUT | No file provided |
| 400 | PASSWORD_PROTECTED | PDF is password-protected |
| 401 | AUTHENTICATION_REQUIRED | Missing or invalid API key |
| 500 | PROCESSING_FAILED | Conversion failed |
/v1/convert/pdf-to-imagecurl -X POST "https://api.morphopdf.com/v1/convert/pdf-to-image?format=binary&dpi=150" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@document.pdf" \
--output images.zip{
"success": true,
"message": "File processed successfully",
"fileName": "page-1.png",
"downloadUrl": "https://files.morphopdf.com/sessions/abc123/output/page-1.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=3600&...",
"pageCount": 1
}