---
title: "Images to PDF (one image per page)"
method: POST
path: "/pdf-from-images"
tags: ["PDF"]
---

# Images to PDF (one image per page)

`POST /pdf-from-images`

## Request

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

Turns 1 to 20 PNG/JPEG images into a PDF. page_size "auto" makes each page the size of its image; A4, A3, A5, Letter, Legal or Tabloid fit the image inside.

Costs 1 credit per call.

## Request body

- object
  - `images` string[], required: The images to include, one per page and in order: 1 to 20 base64-encoded PNG or JPEG strings (about 4 MB in total).
  - `page_size` 'auto' | 'A4' | 'A3' | 'A5' | 'Letter' | 'Legal' | 'Tabloid': Page size: "auto" (default: each page matches its image), "A4", "A3", "A5", "Letter", "Legal" or "Tabloid".
  - `output` 'json' | 'binary' | 'url' | 'pdf': How to return the PDF: "json" (base64 in the JSON response), "binary" (the PDF 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`

The resulting PDF (shape depends on `output`).

- union
  - object
    - `success` boolean
    - `pdf` string, byte
    - `mime_type` 'application/pdf'
    - `meta` object
      - `size_bytes` integer
      - `images_used` integer
      - `page_size` string
      - `used` integer: Credits used this month, after this call.
      - `remaining` integer, nullable: Credits left this month (null = unlimited).
      - `unlimited` boolean
  - object: Returned when output=url: a temporary download link (valid 15 minutes).
    - `success` boolean
    - `url` string, uri: Temporary download link. Expires in 15 minutes.
    - `expires_at` string, date-time
    - `mime_type` string
    - `size_bytes` integer
    - `meta` object
      - `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)
