Docs/APIs/PDF to Image

PDF to Image

Render PDF pages as PNG or JPG images

OperationalCredits 10 per callp50 1729msDocumentsStar

Overview

Pages are rendered with Poppler, the PDF engine used by most Linux desktops, so text, vector graphics, images and page rotation come out as a PDF viewer shows them. Very large pages are rendered at a lower dpi so no image exceeds 25 megapixels, and each image reports the dpi it was rendered at. Encrypted PDFs are rejected.

Live Test PDF to Image API →

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

POSThttps://api.apiverve.com/v1/pdftoimage
curl -X POST https://api.apiverve.com/v1/pdftoimage \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "pdf": "https://raw.githubusercontent.com/mozilla/pdf.js/master/web/compressed.tracemonkey-pldi-09.pdf",
  "pages": "1-2",
  "format": "png"
}'

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Parameters

Sent as JSON in the request body. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
pdfOptionalstringThe PDF file to render (up to 10 MB), or a public PDF URL
pagesOptionalstringPages to render, as numbers and ranges such as 1-3,5; at most 10 per call on paid plans, 1 on the Free plan
default 1 · length 0–100
formatOptionalstringImage format
pngjpgjpeg
default png
qualityOptionalintegerJPG quality from 1 to 100; ignored for PNG
default 90 · range 1–100
dpiOptionalPremiumintegerResolution in dots per inch, from 72 to 300
default 150 · range 72–300

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "status": "ok",
  "error": null,
  "data": {
    "pageCount": 14,
    "format": "png",
    "dpi": 150,
    "imageCount": 2,
    "expires": 1792400000000,
    "images": [
      {
        "page": 1,
        "imageName": "3b7e9d21-4c5a-4f80-a1d6-9e2c8b7f5a34-1.png",
        "width": 1275,
        "height": 1650,
        "dpi": 150,
        "size": 214533,
        "downloadURL": "https://storage.googleapis.com/apiverve/APIData/pdftoimage/3b7e9d21-4c5a-4f80-a1d6-9e2c8b7f5a34-1.png?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1792400000&Signature=S…"
      },
      {
        "page": 2,
        "imageName": "3b7e9d21-4c5a-4f80-a1d6-9e2c8b7f5a34-2.png",
        "width": 1275,
        "height": 1650,
        "dpi": 150,
        "size": 198207,
        "downloadURL": "https://storage.googleapis.com/apiverve/APIData/pdftoimage/3b7e9d21-4c5a-4f80-a1d6-9e2c8b7f5a34-2.png?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1792400000&Signature=S…"
      }
    ]
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
pageCountnumber14Total pages in the PDF
formatstring"png"Image format (png or jpg)
dpinumber150Requested resolution in dots per inch
imageCountnumber2Number of pages rendered
expiresnumber1792400000000When the download links expire (Unix time in milliseconds)
imagesarray[2]One entry per rendered page, in the order requested
pagenumber1Page number
imageNamestring"3b7e9d21-4c5a-4f80-a1d6-9e2c8b7f5a34-1.png"File name of the image
widthnumber1275Image width in pixels
heightnumber1650Image height in pixels
dpinumber150Resolution the page was rendered at; lower than requested only for very large pages
sizenumber214533Image size in bytes
downloadURLstring"https://storage.googleapis.com/apiverve/APIData/pdftoimage/3b7e9d21-4c5a-4f80-a1d6-9e2c8b7f5a34-1.pn…"Signed link to download the image, valid for 2 days

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Use cases

Document Thumbnails
Show a preview image of the first page of uploaded PDFs in file lists and search results.
Page Previews
Display individual pages of a contract or report as images where a PDF viewer is not available.
OCR Pipelines
Turn scanned PDF pages into images for the Image to Text API or another OCR step.
Social and Email Images
Use a page of a brochure, menu or flyer PDF as an image in posts and newsletters.

Other ways to use PDF to Image

Set up PDF to Image on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKit →Reference →

More in Documents:

Was this page helpful?