Image to PDF

Image to PDF API

File Tools

Turn JPG, PNG and other images into a PDF, one image per page. Reorder them, choose A4, Letter or fit-to-image pages, and download. No upload.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

20 requests per minute

Endpoints

1 endpoint available

Overview

Turn images into a PDF with one image per page, in the order sent. Each image is scaled to fit inside the margins and centred. JPEGs and PNGs are embedded without recompression; JPEGs with an EXIF rotation are turned upright first. Other formats (WebP, GIF, AVIF, TIFF) are converted to PNG.

Page size

  • a4 or letter: standard pages. With orientation=auto, landscape images get landscape pages.
  • fit: each page is the size of its image (at 96 pixels per inch) plus the margin. Orientation is ignored.

Limits

  • 1 to 20 images, up to 25 MB and 100 megapixels each.
  • HEIC images are not supported. Convert them to JPEG first.

Endpoints

POST
https://opentools.ca/api/v1/tools/image-to-pdf
Convert images to a PDF, one image per page

Request Body

Content-Type: multipart/form-data

ParameterTypeRequiredDescription
files
file[]
Required
The images (JPEG, PNG, WebP, GIF, AVIF or TIFF), 1 to 20, in page order.
pageSize
string
Enum: a4, letter, fit
OptionalPage size.Default: a4
orientation
string
Enum: auto, portrait, landscape
OptionalPage orientation for a4 and letter. auto picks landscape for wide images.Default: auto
margin
string
Enum: none, small, large
OptionalSpace around each image: none (0), small (18 pt, 1/4 inch) or large (40 pt).Default: small

Response Example

The PDF file (Content-Type: application/pdf). Named after the image when there is one, otherwise images.pdf.

Error Codes

400
Bad Request - missing or invalid fields (see details)
401
Unauthorized - missing or invalid API key
403
Forbidden - API key inactive or expired, or request IP not allowed
413
Payload Too Large - a file is over 25 MB
415
Unsupported Media Type - a file is not an image
422
Unprocessable - an image could not be read or added to the PDF
429
Too Many Requests - more than 20 requests per minute for this key
500
Internal Server Error

Code Examples

curl -X POST https://opentools.ca/api/v1/tools/image-to-pdf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "files=@page1.jpg" \
  -F "files=@page2.png" \
  -F "pageSize=letter" \
  -F "margin=none" \
  -o images.pdf

Ready to get started?

Create an API key to start using the Image to PDF API.

Rather use it in your browser? Open the Image to PDF