Skip to main content
You can render any template as a PDF. This is useful for invoices, receipts, labels, and certificates, where you design the layout once and fill in the details for each customer.

What a PDF contains

A generated PDF has one page. The page is as wide and as high in points as the canvas is in pixels. Text, shapes, and borders are drawn as vectors, so they stay sharp at any zoom, and a reader can select, copy, and search the text. The PDF embeds the fonts that the text uses, and images keep their own resolution. A PDF cannot draw the blur() and drop-shadow() filters. A template that uses them answers 400 with a BAD_REQUEST error; remove the filters to render it as a PDF. A blurred box shadow is drawn as a soft vector shadow, so it can look a little different from the PNG of the same template. The A4 @72dpi preset in the editor sets the canvas to 595 by 842, an A4 portrait page. The A4 @96dpi and A4 @300dpi presets make larger pages (794 by 1123 and 2480 by 3508 points). Design the canvas for the longest content you expect, because a template does not grow to a second page.

Generate a PDF

  1. Create an API key on the API Keys page and copy the template id from the template card menu.
  2. Send a POST request to /v1/templates/createPdf with a JSON body:
  1. Read the response. The body is the PDF file, and the Content-Type header is application/pdf.
A PDF request takes three fields: apiKey, templateId, and modifications. It has no format or quality option. Modifications explains how to fill text, images, and tables. POST /v1/templates/createStoredPdf takes the same body and returns a URL in place of the bytes:
Bannerify saves the file and serves it from its CDN at a public URL. On the Scale and Enterprise plans you can also send an s3Config object to save the file to your own S3-compatible bucket. Storage and notifications lists its fields.

Use an SDK

The JavaScript, Python, PHP, and Go SDKs have a createPdf method that returns the bytes. No SDK wraps createStoredPdf, so call that endpoint over REST. Create images and PDFs shows the JavaScript version.

Quota and errors

Each PDF counts as one generation. Quota and limits lists what counts and which limits apply. A failed request returns JSON with an error object, and Errors lists the codes.