LogoLogo
HomePricingSign inRegister
  • PDFMonkey Documentation
  • Guides
    • From zero to generating your first Document
    • Generating your first Document with Zapier
    • Generating your first Document with Make
    • Making your first API call
  • PDFMonkey Features
    • 14-day Pro trial
    • Automatic deletion (TTL)
    • CLI
    • Generating images
    • Share links
    • Synchronous generation
    • Snippets
    • Webhooks
  • Frequent questions
    • Troubleshooting
      • My Document is blank
      • My data is not showing up in the Document
      • The Download URL is empty
    • What can you do with PDFMonkey?
    • What happens if I use all of my quota?
    • How do I change my password?
    • How do I delete my account?
    • Authoring Templates
      • Can I import an existing PDF or Word file in PDFMonkey?
      • What are the Template test data?
      • Can you create templates for me?
      • Can I display the number of the current page in the content?
      • Can I use links?
    • Privacy and security
      • What data do you keep and for how long?
      • How is my data secured?
      • Do you have a DPA
    • Compliance
  • How-tos
    • Adding a header or footer to your document
    • Including images in your documents
    • Styling your documents
      • Writing your own CSS
      • Using external libraries
      • Providing per-Document styles
      • Dealing with page breaks
    • Using different fonts
      • Handling special characters (UTF-8, Hebrew, Chinese, etc)
      • Using different fonts in header and footer
    • Using JavaScript
      • What are the available JavaScript features
      • JavaScript and Dynamic Data
      • Using external libraries
      • Displaying dates and time using JS
      • Including charts in your Documents
      • Debugging your JavaScript
    • Setting the filename of the generated Document
    • Changing the size of the page and its margins
    • Forcing a single page or use a full-page background
    • Using QR Codes
  • Integrations
    • List of integrations
    • Zapier
      • Generating your first Document with Zapier
      • Document generation options in Zapier
      • Reacting to generated documents in Zapier
      • TODO Retrieving a Document in Zapier
      • TODO Deleting a document using Zapier
      • Fixing frequent Zapier errors
    • Make (formerly Integromat)
      • Generating your first Document with Make
    • Workato
      • Generating a document with Workato
      • Deleting a document using Workato
      • Reacting to generated documents in Workato
    • Glide
    • Bubble
    • InvoiceBerry (via Zapier)
    • Ruby SDK
  • References
    • The Document Lifecycle
    • Liquid Reference
      • Introduction
      • Defining and using dynamic data
      • Variables
      • Naming variables
      • Conditions (if/else)
      • Iteration (dealing with lists)
      • Filters (data transformation)
        • Built-in filters
        • PDFMonkey filters
      • PDFMonkey Liquid tags
      • Whitespace control
    • API Reference
      • Documents
      • Templates
Powered by GitBook
On this page
  • Image Templates
  • Generating an image
  • Generation-time options

Was this helpful?

  1. PDFMonkey Features

Generating images

This guide explains how to create image templates and generate images using PDFMonkey.

PreviousCLINextShare links

Last updated 15 days ago

Was this helpful?

With the release of Engine v5, PDFMonkey can now generate images. In this guide we will look at the creation of image templates and documents that use them.

Image Templates

In order to generate images, you need to create an image Template. You can do so by selection the "Image" output type when creating your template.

Pro tip

You can also duplicate an existing template and update its output type to "Image".

Why have separate Template types?

The main reason to have Templates dedicated to images is that PDF and images behave very differently. While PDF documents can have header and footer or various paper formats, image support transparent backgrounds and specific dimensions.

Once your template is created, you can update its settings to set its dimensions and decide if you want to use a transparent background or not.

Generating an image

By default a webp image will be created. It's a well supported format that provides good quality at a reasonable size and supports transparent background.

Generation-time options

There are a few options you can provide to change the image you generate. They are all provided through the Documents' meta-data:

Request body
{
  "document": {
    "document_template_id": "...",
    "payload": { ... },
    "status": "pending",
    "meta": {
      "_type": "png", // can be webp, png or jpg
      "_width": 123,  // in px
      "_height": 123, // in px
      "_quality": 80  // quality %, only supported by webp (default: 100)
    }
  }
}

To generate an image, you simply have to call the API the same way you do to generate a PDF, by calling the POST /api/v1/documents endpoint (or POST /api/v1/documents/sync for ).

sync generation