May 1, 2023

How to use Zapier to create PDFs with Stencil

Learn how to generate high-quality PDFs with ease using Zapier's automation tool and Stencil's design capabilities with this comprehensive guide.

Welcome to this tutorial on how to use Zapier to create a PDF! In today's digital age, having the ability to quickly generate high-quality PDFs is essential for many individuals and businesses. Fortunately, with Zapier, creating PDFs has never been easier.

Zapier is a powerful automation tool that allows you to connect different apps and services, and automate workflows to save time and streamline your processes.

In this tutorial, we will walk you through creating a PDF document using Zapier from Stencil's template.

1. Design your template

The Stencil template editor, which functions as both a PDF and image creator, is simple and straightforward to use. With this tool, you can create a dynamic design with replaceable layers, enabling you to generate multiple images or PDFs automatically from the same template in no time.

For this tutorial, we would like to use Zapier to generate a gift voucher automatically for our customers. Our template looks something like this.

The amount $200 (and any other layers) can be replaced dynamically.

Why use Zapier?

Even without Zapier, you still can generate a PDF right from Stencil like in our previous tutorial here: How to create gift certificate voucher for free!. Zapier allows you to extend Stencil's PDF capability to other apps.

2. Create your Zap

To create your Zap,click on '+ Create Zap'. Then, select a trigger that will trigger your Zap.

The required step will vary based on your specific needs. For instance, if you keep track of customer information using Google Sheets or Airtable, you could set up a trigger to generate a new voucher every time a new row is added to the sheet.

For our purposes, we want to activate the Zap when Stripe receives an event indicating that a subscription has been canceled. Our objective is to enhance customer retention, and one of our marketing strategies involves offering vouchers to incentivize customers to return.

Zap is triggered when a customer canceled a subscription

3. Set up Stencil as the Zap action

After setting up the trigger, the next step is to create the action. Search for "Stencil" and choose "Create a PDF" for the event.

Select Create a PDF event to create a PDF

Next, you will need to connect to your Stencil account and provide the API key located in your project settings. It's important to ensure that you use the correct API key for your project to ensure that Zapier displays the appropriate templates.

API key can be found in projects setting page

Choose the "Voucher" template from the available options. Once you've selected the template, all available modifications will automatically be displayed, eliminating the need to remember which inputs are required.

4. Adjust your Zap action

To craft the right PDF, it is essential to apply the correct modifications to the template.

Stencil Zapier integration shows all available modfications for your template

One thing to note is that, PDF generation happens asynchronously. Thus, the Zap will return immediately. If you need to check whether the PDF is ready, you can use "Instant trigger".

Stencil provides Instant Trigger for any generated images or PDFs

5. Run your Zap

You can run your Zap to generate the PDF.

Stencil provides request logs for all requests including PDF generation request. Go to Stencil, and click on Requests on the left sidebar.

Then select PDFs, and you should see all the generated PDFs.

6. What's next?

While this tutorial covers the fundamentals of using Stencil in conjunction with Zapier, there are many ways to customize and expand upon this integration to suit your specific needs.

For example, you could link this Zap to your Gmail account and send the voucher directly to your customers via email. There are numerous other compelling applications for this integration, such as generating personalized certificates or creating dynamic social media graphics. The possibilities are virtually endless!

We hope that this helps!

--

Ready to dive in?Start your free trial today.