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 theblur() 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
- Create an API key on the API Keys page and copy the template id from the template card menu.
- Send a
POSTrequest to/v1/templates/createPdfwith a JSON body:
- Read the response. The body is the PDF file, and the
Content-Typeheader isapplication/pdf.
apiKey, templateId, and modifications. It has no format or quality option. Modifications explains how to fill text, images, and tables.
Get a link instead of a file
POST /v1/templates/createStoredPdf takes the same body and returns a URL in place of the bytes:
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 acreatePdf 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 anerror object, and Errors lists the codes.