Quickstart

1. Create a template

The easiest way to develop templates is to use our template editor.

Check out the starter template in your templates library. You’ll see that a template is just some HTML and Liquid. Change some code, and hit Render Preview to see a preview on the right-hand side. As you type, all your working changes are automatically saved.

By changing the variables in variables.json you can preview how the template will look with different data. However, for actual production usage, you’ll pass these variables in the request body (shown below).

When you’re ready, hit Publish to deploy a new version of your template. You can now use this template to generate PDFs. 🎉

2. Generate a PDF with some variables

To create a PDF, you will simply fire a request to the /v1/pdf API endpoint, using the slug of the template you just published.

1
Post to the API
Using the code below, you POST a multipart/form-data request to the API. In response, you get back the PDF as a stream, which is saved to a file.
Language:
OS:
if curl '/v1/pdf' \
  -X POST \
  -o result.pdf \
  -f \
  -H 'x-api-key: YOUR_API_KEY' \
  -F 'workflow="{\"parts\":[{\"type\":\"template\",\"slug\":\"hello-world@latest\",\"variables\":{\"name\":\"John Doe\",\"address\":\"123 Main St, Anytown, USA\"}}]}"'; then
  echo "Success! Your PDF is saved to 'result.pdf'"
else
  echo "Please check your logs at /requests"
fi
2
Store your PDF
Optional
It's a good idea to move your PDF file to a storage provider (e.g., AWS S3, Google Cloud Storage) where you can retrieve it later.
Generate PDFs at scale, without the DevOps.
Documentation
Support