Docs/Skills/Image to PDF

Image to PDF

Combine images into one PDF

OperationalCredits 10 per callp50 1365msDocuments

Overview

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.

Live Test Image to PDF Skill →

The tool

Once your client is connected to the VerveKit server, this appears in its tool list as ImagetoPDF. It is read-only and open-world — it fetches and never mutates anything on your side — so most clients call it without asking you to confirm.

Tool call
{
  "name": "ImagetoPDF",
  "arguments": {}
}

Connecting

One server URL covers every skill in the catalog, including this one. Authorization is OAuth: the client opens a browser once, and there is no key to paste into a config file.

{
  "mcpServers": {
    "vervekit": {
      "url": "https://api.vervekit.com/v1/mcp"
    }
  }
}

Per-client setup — Claude, Cursor, VS Code, ChatGPT — is on the MCP setup page.

Arguments

These are the properties on the tool's inputSchema, so a well-behaved client validates them before the call is made. Premium arguments are accepted on every plan but only take effect on plans that include them.

ArgumentTypeDescription
imageOptionalstringAn image file (upload one or more as multipart files, up to 20), base64 image data, or a public image URL
urlsOptionalarrayA JSON array of public image URLs, added in order after image. Up to 20 images per call in all
pageSizeOptionalstringPage size: fit makes each page the size of its image; a4, letter and legal fit the image inside the margins
fita4letterlegal
default a4
orientationOptionalstringPage orientation for a4, letter and legal; auto turns each page to match its image. Ignored for fit
autoportraitlandscape
default auto
marginOptionalnumberMargin around each image in millimetres, from 0 to 50
range 0–50
qualityOptionalintegerRe-compress every image as JPG at this quality (1-100) to make the PDF smaller. Omit to keep JPG and PNG images unchanged
range 1–100

What the model gets back

The result carries a structuredContent object matching the tool's declared outputSchema, so a client reads fields without parsing prose. status is "ok" and error is null on success; a null field means the value was not available for that input, not that the call failed.

Result
{
  "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"
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
pdfNamestring7c1e4b9a-2f3d-4e8a-9b6c-5d0a1f2e3c4b.pdfFile name of the PDF
imageCountnumber2Number of images received
pageCountnumber2Pages in the PDF; more than imageCount when a GIF or TIFF has several frames
pageSizestringa4Page size used
orientationstringautoOrientation setting used; null for fit
marginnumber10Margin in millimetres
qualityobjectnullJPG quality images were re-compressed at, or null when they were kept unchanged
sizenumber483291Size of the PDF in bytes
expiresnumber1792400000000When the download link expires (Unix time in milliseconds)
downloadURLstringhttps://storage.googleapis.com/apiverve/APIData/imagetopdf/7c1e4b9a-2f3d-4e8a-9b6c-5d0a1f2e3c4b.pdf?…Signed link to download the PDF, valid for 2 days

Failure modes

Errors come back as tool errors carrying a sentence the model can act on, not a bare status code. Error handling covers the full list.

StatusWhat it means
400 / 422The arguments did not validate. The message names the offending one.
401The OAuth session is invalid or expired — reconnect the server.
403Blocked by a key restriction or an IP allow-list. Never a bad identity.
404This skill is not part of VerveKit. Check the catalog.
429Out of credits, or a brief rate limit. The message tells them apart.

A call costs 10 credits each time the tool actually runs; a model that reasons about the tool without calling it costs nothing.

Use cases

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.

Other ways to use Image to PDF

Set up Image to PDF on VerveKit, or reach the same source a different way. Your VerveKit account and credits work on all of them — one key, one balance.

Call it as a REST APIOne HTTPS endpoint and an x-api-key header, with SDKs for Node, Python and .NET.APIVerve →Reference →

More in Documents:

Was this page helpful?