Create PDF Report with Segment data from HTML Template using PDF.co

In this tutorial, we will create a PDF Report to show the total number of users per country. We will use the PDF.co HTML Template and Zapier Webhook to generate this dynamic PDF Report.

We assume that you have already set up your Zapier Webhook to receive data from Segment.

Step 1: Add PDF.co HTML to PDF Converter

To begin, let’s choose PDF.co as the App and the HTML to PDF Converter as the Action Event.

Use PDF.co HTML To PDF Converter

Step 2: Set HTML Template Id

In the HTML Template Id field, enter the ID of the HTML Template you would like to use. You can create and get your HTML Template Id with our HTML Template Editor. The HTML Template supports both Mustache and Handlebars.

Set HTML Template ID

Step 3: Input Template Data

In the HTML Template Data field, enter the JSON or CSV of your template data and replace the underlined values with data from Webhook.

JSON Template Data

Step 4: Test Action

Now it’s time to make a PDF.co call and test our HTML to PDF Conversion setup.

Send Configuration To PDF.co

Step 5: PDF.co Result

Great! PDF.co returned a temporary URL to view and download the PDF output.

PDF.co Output URL
PDF Report from HTML Template and Segment Data

Step 6: PDF Report

Here’s the PDF Report we generated from the HTML Template with Segment data.

PDF Report From HTML Template And Segment

In this tutorial, you learned how to create a PDF Report with Segment data from HTML Template using PDF.co. You learned how to send your Segment data to Zapier via Webhook. You also learned how to set up the HTML Template and the Template Data to generate a PDF Report.