# PDF to Image API

> PDF to Image renders the pages you choose from a PDF, uploaded or fetched from a URL, as PNG or JPG images and returns a download link for each, valid for 2 days, with its pixel size. The Free plan renders one page per call at 150 dpi; paid plans render up to 10 pages per call and can set the resolution from 72 to 300 dpi.

**Endpoint:** `POST https://api.apiverve.com/v1/pdftoimage`  
**Category:** Documents  
**Cost:** 10 credits per call  
**Canonical page:** https://apiverve.com/marketplace/pdftoimage

## 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.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/pdftoimage" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "pdf=@document.pdf" \
  -F "pages=1-2" \
  -F "format=png" \
  -F "quality=90" \
  -F "dpi=150"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `pdf` | string | No | The PDF file to render (up to 10 MB), or a public PDF URL |
| `pages` | string | No | Pages 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 |
| `format` | string | No | Image format. default png. One of: png, jpg, jpeg |
| `quality` | integer | No | JPG quality from 1 to 100; ignored for PNG. default 90. range 1-100 |
| `dpi` | integer | No | Resolution in dots per inch, from 72 to 300. default 150. range 72-300. Premium field |

## Response fields

- `pageCount` — number · Total pages in the PDF
- `format` — string · Image format (png or jpg)
- `dpi` — number · Requested resolution in dots per inch
- `imageCount` — number · Number of pages rendered
- `expires` — number · When the download links expire (Unix time in milliseconds)
  - `images.0.page` — number · Page number
  - `images.0.imageName` — string · File name of the image
  - `images.0.width` — number · Image width in pixels
  - `images.0.height` — number · Image height in pixels
  - `images.0.dpi` — number · Resolution the page was rendered at; lower than requested only for very large pages
  - `images.0.size` — number · Image size in bytes
  - `images.0.downloadURL` — string · Signed link to download the image, valid for 2 days

## Sample response

```json
{
  "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=SAMPLE"
      },
      {
        "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=SAMPLE"
      }
    ]
  }
}
```

## 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.

## More

- Full reference: https://docs.apiverve.com/ref/pdftoimage
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
