PDF to Image

PDF to Image API

File Tools

Convert PDF pages to JPG or PNG images at 72, 150 or 300 DPI. Download one page or a ZIP of them all. Runs in your browser with no upload.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

20 requests per minute

Endpoints

1 endpoint available

Overview

Render PDF pages to JPG or PNG images. Render every page, or pick pages with pages. Password-protected PDFs can be opened with password.

Response

One page comes back as the image itself (image/jpeg or image/png). Several come back as a ZIP (application/zip) of files named like report-page-3.jpg. Headers:

  • X-Page-Count: number of images returned.
  • X-Downscaled: true when a very large page was rendered below the requested DPI to stay within 16 megapixels.

Limits

  • One PDF up to 25 MB. At most 100 pages per request; use pages to render a long document in parts.
  • Each image is at most 16 megapixels and 16,000 px on a side.

Endpoints

POST
https://opentools.ca/api/v1/tools/pdf-to-image
Convert PDF pages to JPG or PNG images

Request Body

Content-Type: multipart/form-data

ParameterTypeRequiredDescription
file
file
Required
The PDF.
format
string
Enum: jpg, png
OptionalImage format.Default: jpg
dpi
integer
OptionalResolution, 72 to 300. 72 for screens, 150 for most uses, 300 for printing.Default: 150
quality
integer
OptionalJPEG quality, 50 to 100. Ignored for PNG.Default: 90
pages
string
OptionalPages to render, e.g. "1-3, 5". Empty means every page.
password
string
OptionalPassword for a protected PDF.

Response Example

One image (Content-Type: image/jpeg or image/png), or a ZIP of images (Content-Type: application/zip). Headers: X-Page-Count, X-Downscaled.

Error Codes

400
Bad Request - missing or invalid fields (see details)
401
Unauthorized - missing or invalid API key
403
Forbidden - API key inactive or expired, or request IP not allowed
413
Payload Too Large - a file is over 25 MB
415
Unsupported Media Type - the file is not a PDF
422
Unprocessable - the PDF is damaged, needs a password (or the password is wrong), a page number is out of range, or more than 100 pages were requested
429
Too Many Requests - more than 20 requests per minute for this key
500
Internal Server Error

Code Examples

# First page as a PNG
curl -X POST https://opentools.ca/api/v1/tools/pdf-to-image \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@slides.pdf" \
  -F "format=png" \
  -F "dpi=150" \
  -F "pages=1" \
  -o slide-1.png

# Every page as JPGs in a ZIP
curl -X POST https://opentools.ca/api/v1/tools/pdf-to-image \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@slides.pdf" \
  -o slides-jpg.zip

Ready to get started?

Create an API key to start using the PDF to Image API.

Rather use it in your browser? Open the PDF to Image