🏗️

Images to PDF

Combine one or more images into a PDF document with one image per page

POST 1 credit /v1/pdf/from-images
curl -X POST "https://pdf.toolkitapi.io/v1/pdf/from-images" \
  -H "Content-Type: application/json" \
  -d '{
    "image_urls": [
      "https://toolkitapi.io/page1.jpg",
      "https://toolkitapi.io/page2.jpg",
      "https://toolkitapi.io/page3.jpg"
    ],
    "page_size": "A4",
    "margin": 36
  }'
import httpx

resp = httpx.post(
    "https://pdf.toolkitapi.io/v1/pdf/from-images",
    json={
    "image_urls": [
      "https://toolkitapi.io/page1.jpg",
      "https://toolkitapi.io/page2.jpg",
      "https://toolkitapi.io/page3.jpg"
    ],
    "page_size": "A4",
    "margin": 36
  },
)
print(resp.json())
const resp = await fetch("https://pdf.toolkitapi.io/v1/pdf/from-images", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "image_urls": [
      "https://toolkitapi.io/page1.jpg",
      "https://toolkitapi.io/page2.jpg",
      "https://toolkitapi.io/page3.jpg"
    ],
    "page_size": "A4",
    "margin": 36
  }),
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "pdf": "JVBERi0xLjcKMSAwIG9iago8...",
  "page_count": 3,
  "file_size": 892416,
  "image_count": 3
}

Description

Combine one or more images into a PDF document with one image per page

How to Use

1

1. Provide images via `images` (base64 array) or `image_urls` (URL array). One image per page, in order.

2

2. Choose a `page_size` — defaults to `A4`. Options: `A3`, `A4`, `A5`, `Letter`, `Legal`.

3

3. Set `margin` in points if needed (default: 36 points = 0.5 inch). Range: 0–144.

4

4. The response contains the generated PDF as base64 with page count and file size.

About This Tool

Images to PDF combines one or more JPEG or PNG images into a single PDF document, placing each image on its own page. Images are automatically scaled to fit the selected page size while preserving their aspect ratio, and centered within the margins.

Use this tool to turn photo collections, scanned pages, or screenshots into a clean PDF — ready to share, print, or archive. It supports up to 50 images per request and offers standard page sizes (A4, Letter, Legal, A3, A5) with configurable margins.

Both base64-encoded images and public URLs are accepted, making it easy to work with images from any source.

Why Use This Tool

Frequently Asked Questions

What image formats are supported?
JPEG and PNG images are supported. RGBA and palette-mode PNG images are automatically converted to RGB for PDF compatibility.
How are images scaled?
Each image is scaled to fit within the page's usable area (page size minus margins) while preserving its aspect ratio. Images smaller than the page are not upscaled — they're centered at their original size.
What's the maximum number of images?
You can include up to 50 images per request. Each image becomes one page in the output PDF.

Start using Images to PDF now

Get your free API key and make your first request in under a minute.