NewAPIVerve Academy: free courses and certifications anyone can verify.Explore the Academy →

Image to PDF API

POST

Turn JPG, PNG, HEIC, WebP, GIF and TIFF images into a single PDF, one image per page.

Image to PDF combines up to 20 images, uploaded or fetched from URLs, into one PDF with one image per page, and returns a download link valid for 2 days. Pages can match each image or be A4, Letter or Legal with a margin, and multi-page TIFF scans and animated GIFs become one page per frame.

Try it — live request, no key required

Request
POSTapi.apiverve.com/v1/imagetopdf
image
Click or drag a file to upload.jpg, .jpeg, .png, .gif, .webp, .bmp, .tif, .tiff, .heic, .heif, .avif · max 400KB for live testing
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "pdfName": "7c1e4b9a-2f3d-4e8a-9b6c-5d0a1f2e3c4b.pdf",
    "imageCount": 2,
    "pageCount": 2,
    "pageSize": "a4",
    "orientation": "auto",
    "margin": 10,
    "quality": null,
    "size": 483291,
    "expires": 1792400000000,
    "downloadURL": "https://storage.googleapis.com/apiverve/APIData/imagetopdf/7c1e4b9a-2f3d-4e8a-9b6c-5d0a1f2e3c4b.pdf?GoogleAccessId=635500398038-compute%40developer.gserviceaccount.com&Expires=1792400000&Signature=SAMPLE"
  }
}

About the Image to PDF API

JPG and PNG images are placed in the PDF exactly as they are, without re-compression, so the PDF keeps their full quality. HEIC, WebP, AVIF, BMP, GIF and TIFF images are converted first, and phone photos are turned upright from their EXIF orientation. Set quality to re-compress every image as JPG and make the PDF smaller.

On A4, Letter and Legal pages each image is scaled to fit inside the margins and centred, in portrait or landscape to match the image unless you choose an orientation. With pageSize fit, each page is the size of its image. The Free plan builds PDFs of up to 5 pages; paid plans build up to 100.

How it works

The PDF is assembled with pdf-lib. Inputs arrive as multipart file parts (any field name, in form order), or as image (base64 data or a URL) followed by the URLs in urls. Each file is identified from its first bytes, not its name. URLs are downloaded with a 10 MB limit each and a 20-second timeout and must point to public hosts. More than 20 images, a file over 10 MB or 25 MB in total, or an unsupported format returns an error naming the problem, and no PDF is made.

JPEG and PNG images are embedded as they are: JPEG bytes are copied into the PDF unchanged and PNG pixels are stored losslessly. A JPEG whose EXIF orientation is not upright, and every HEIC, AVIF, WebP, BMP, GIF and TIFF image, is first decoded by APIVerve's image service (ImageMagick) and turned upright; photo formats come back as JPEG at quality 90 and the rest as PNG. Every frame of a GIF or TIFF becomes its own page, animated GIF frames composited as they display. When quality is set, every image goes through that step and is re-encoded as JPEG at that quality, with transparency flattened onto white.

With pageSize fit, each page measures the image at 96 pixels per inch (0.75 points per pixel) plus the margin on every side, capped at the 200-inch PDF limit. With a4 (595.28 x 841.89 pt), letter (612 x 792 pt) or legal (612 x 1008 pt), the image is scaled up or down to fit inside the margins, keeping its aspect ratio, and centred; orientation auto picks landscape when the image is wider than it is tall. pageCount can exceed imageCount because of multi-frame files. The Free plan stops at 5 pages and paid plans at 100; going over returns 403 or 400 before anything is stored.

What people use it for

Receipt and Expense Uploads
Bundle photos of receipts taken on a phone into one PDF for an expense report or an accounting system.
Scanned Document Packs
Turn multi-page TIFF scans or a set of page photos into a single PDF that any viewer can open.
Photo Books and Portfolios
Assemble product shots or portfolio images into a PDF for clients, with consistent paper size and margins.
Form Attachments
Accept images in an upload form and store or forward them as one PDF, the format many back-office systems require.

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Image to PDF

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Image to PDF API.

Read the docs →
Which image formats can I convert?
JPG, PNG, GIF, WebP, BMP, TIFF, HEIC (iPhone photos) and AVIF. Multi-page TIFF files and animated GIFs become one page per frame.
Does converting reduce image quality?
Not by default. JPG and PNG images are embedded unchanged. Other formats are converted, photos to high-quality JPG and graphics to lossless PNG. Only when you set quality are all images re-compressed as JPG at that quality, to make the PDF smaller.
How are images placed on A4 or Letter pages?
Each image is scaled to fit inside the page margins, keeping its proportions, and centred. With orientation auto (the default) a wide image gets a landscape page and a tall one a portrait page. margin is in millimetres, from 0 to 50.
What does the Free plan include?
The Free plan builds PDFs of up to 5 pages per call with every option, and uploads are limited to 400 KB. Paid plans build up to 100 pages per call from up to 20 images of 10 MB each.
How much does a conversion cost?
Each request costs 10 credits, whether the PDF has 1 page or 100. Starter covers 20,000 requests a month, about $0.0015 per request. The Free plan includes 20 requests a month.
How long is the PDF kept?
The download link is a signed URL that expires after 2 days, given in expires as a Unix timestamp in milliseconds.

Ready to build with Image to PDF? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs