Create PDF document from HTML template in Zapier or Power Automate
This article demonstrates how to generate PDF documents from an HTML template with the help of Plumsail Documents processes.
The Processes are a user-friendly intuitive interface for creating documents from templates, converting them, and delivering to different systems for further management.
In this article, we will generate a PDF invoice based on some data. This is how our final PDF file will look:
Here is a step-by-step description of creating a process of generating PDF documents from an HTML template.
Configure Process
First, register or log in to your Plumsail account.
Create a new process
In your Plumsail account, open the Processes section.
In this example, we will use a sample template. Feel free to download an HTML template for invoices.
Click Add Process and select Upload a document.
Enter the Process name, select PDF as the output format and click Create.
If you prefer to create the template yourself, click Add Process, select Start from blank instead. Choose HTML for the template type.
Preview the template
Once the process is created, you can preview the uploaded HTML template in the Editor.
Hint
To generate several documents from a single form submission, add multiple templates to your process. Learn more about the set of documents.
Templating syntax
You may see that the template has placeholders like {{Total}} and {{Quantity}}. The {{#each Items}} block iterates over invoice items, and the {{#with FieldValues}} block changes the context to each item’s FieldValues object.
Please read template syntax description for more information.
Test template
To visualize the document before saving it, click Test template.
This JSON data is used to populate the {{ }} placeholders in the template. Therefore, the data must correspond to the tokens in the template.
To test the template from our example, you can copy and paste the JSON data shown below.
Note
This is JSON for testing. You can pass data from an external system or web form to the process. See the Start process section.
{
"InvoiceDate": "08/10/2026",
"InvoiceNum": 1,
"Total": 1098,
"ClientCompany": "Contoso ltd.",
"ClientName": "John Doe",
"ClientAddress": "55 East 52nd Street 21st",
"ClientCity": "New York",
"ClientRegion": "US",
"ClientZip": "10022",
"Items": [
{
"FieldValues": {
"Quantity": 1,
"SubTotal": 499,
"Title": "Product Name #1",
"UnitPrice": "499"
}
},
{
"FieldValues": {
"Quantity": 1,
"SubTotal": 599,
"Title": "Product Name #2",
"UnitPrice": 599
}
}
]
}
Switch the process to Production mode to remove Plumsail watermarks from resulting documents.
Template settings
Open the template settings to configure the output filename and PDF options:
Enter an Output filename for the generated file. You can insert values from your data using tokens.
Use Watermark to add a watermark if needed.
Protect the result PDF if you wish.
Delivery
The next step is delivery. For demonstration purposes, we’ll store the result file in OneDrive. But there are other options.
You need to connect your OneDrive account to Plumsail. After that, specify the folder where you want to save the generated document. Here you can use tokens as well.
You can configure as many deliveries as you need.
Start the Process
Now everything is ready, and you can start generating PDF documents from an HTML template. Click Run process to see the available options with a description of each.
You can run the process:
submitting JSON corresponding to template tokens;
Use Power Automate Flow and Zapier to connect the process with other apps. It enables you to gather data from one app and pass it to the process to populate an HTML template. Thus, you can populate the HTML template from various web forms, CRM systems, SharePoint lists, and thousands of other web applications.