---
title: "PDF pages to PNG images"
method: POST
path: "/pdf-to-images"
tags: ["PDF"]
---

# PDF pages to PNG images

`POST /pdf-to-images`

## Request

- Base URL: `https://api.cofferdock.com`
- URL: `https://api.cofferdock.com/pdf-to-images`
- Auth: API key in header `x-api-key`

Renders each page (or the ones in `pages`) as a PNG. `scale` 1 is 72 dpi; 2 is 144 dpi.

Costs 1 credit per call.

## Request body

- object
  - `file` string, byte, required: The PDF, base64-encoded.
  - `pages` string: Pages to act on, 1-indexed, e.g. "1-3,5,7-9". Default: all pages.
  - `scale` number: Resolution multiplier (0.5-4). Default 1.5; higher = sharper and larger images.
  - `output` 'json' | 'binary' | 'url': How to return the images: "json" (base64 in the JSON response), "binary" (the images itself, ready for n8n/Make/Zapier) or "url" (a temporary download link, valid 15 minutes). Default: json when the request is JSON, binary when the input was sent raw.

## Response `200`

One PNG per page.

- object
  - `success` boolean
  - `images` object[]
    - `page` integer
    - `png` string, byte: Present when output=json.
    - `url` string, uri: Present when output=url.
    - `width` integer
    - `height` integer
  - `meta` object
    - `source_pages` integer
    - `images_created` integer
    - `used` integer: Credits used this month, after this call.
    - `remaining` integer, nullable: Credits left this month (null = unlimited).
    - `unlimited` boolean

## Other responses

- `400`: Invalid input (nothing is charged).
- `401`: Missing or invalid API key.
- `403`: Email not verified.
- `429`: Monthly credit limit reached, or too many requests per minute for this key (see Retry-After).
- `503`: Server busy (queue full). Retry after the seconds in the Retry-After header.

---

[API](https://skmtc.dev/cofferdock/apis/cofferdock-api.md) · [All operations](https://skmtc.dev/cofferdock/apis/cofferdock-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cofferdock/apis/cofferdock-api/revisions/b57aa000d33a?raw)
