How do I render a pdf via API?

You can render your template as a PDF by adding the {render_pdf: true} flag to your request. Note that PDFs are generated at 96 dpi.

Example:

  "modifications": [
    {
      "name": "title",
      "text": "Lorem ipsum dolor sit amed",
      "color": null,
      "background": null
    },
    {
      "name": "avatar",
      "image_url": "https://www.bannerbear.com/assets/sample_avatar.jpg"
    }
  ],
  "render_pdf": true

The API will return the following:

  • pdf_url - Higher quality file, great for printing, but relatively uncompressed which results in larger file size.
  • pdf_url_compressed -  Significantly smaller file size, with very little reduction in visual quality (results may vary).

Here's an example rendered by Bannerbear:

PNG Version (Rasterized)

PDF Version (Vector)

Click to view PDF:

Note: This feature uses 3x image quota

Have a question?

Contact our customer support team anytime via chat or email