PDF to Image

Convert PDF pages to high-quality PNG or JPEG images.

POSThttps://api.morphopdf.com/v1/convert/pdf-to-image

Authentication

AuthorizationBearer

Retrieve your API Key from Dashboard.

Request Body

Provide the PDF file.

fileFile

PDF file uploaded via multipart/form-data.

urlstringOptional

Public URL pointing to a PDF file.

Query Parameters

formatstringOptionalDefault: json

Response format. Use 'binary' to receive the image(s) directly.

imageFormatstringOptionalDefault: png

Output image format. Options: 'png', 'jpg', 'jpeg'.

dpinumberOptional72-600Default: 150

Image resolution in DPI. Options: 72, 96, 150, 300, 600.

qualitynumberOptional1-100Default: 85

JPEG quality (1-100). Only applies to jpg/jpeg format.

pageRangestringOptional

Specific pages to convert. Examples: '1', '1-5', '1,3,5'.

Response

When using format=json (default):

successboolean

Indicates whether the operation completed successfully.

messagestring

Human-readable status message.

fileNamestring

Name of the generated file (ZIP or single image).

downloadUrlstring

Presigned URL to download the file. Valid for 1 hour.

pageCountnumber

Number 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

StatusCodeDescription
400INVALID_INPUTNo file provided
400PASSWORD_PROTECTEDPDF is password-protected
401AUTHENTICATION_REQUIREDMissing or invalid API key
500PROCESSING_FAILEDConversion failed
POST/v1/convert/pdf-to-image
curl -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
200OK
{
  "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
}