How to Generate a PDF from an HTML Template in Make Using PDF.co
PDF.co’s Convert HTML to PDF module for Make can generate PDF documents from reusable HTML templates. You can populate template placeholders with JSON or CSV data supplied directly in Make or mapped from an earlier module.
In this tutorial, you will:
- Prepare an HTML template in PDF.co.
- Create a Make scenario.
- Connect PDF.co to Make.
- Populate the template with JSON data.
- Generate and save the resulting PDF.
This workflow uses PDF.co’s dedicated Convert HTML to PDF module. A custom API call is no longer required.
Step 1: Prepare an HTML Template
Sign in to your PDF.co account and open the HTML to PDF Templates section:
https://app.pdf.co/templates/html
Create a new template or select an existing one.
PDF.co HTML templates support Mustache and Handlebars placeholders. For example:
<h1>Invoice {{invoice_id}}</h1>
<p>Customer: {{client_name}}</p>
<p>Invoice date: {{invoice_date}}</p>
<p>Total: {{total}}</p>The values inside double braces are replaced with the data provided by the Make scenario.
You can also use conditional sections:
{{#if paid}}
<p><strong>Payment status: Paid</strong></p>
{{/if}}Arrays can be rendered with the Handlebars #each helper:
<table>
<thead>
<tr>
<th>Description</th>
<th>Price</th>
</tr>
</thead>
<tbody>
{{#each items}}
<tr>
<td>{{name}}</td>
<td>{{price}}</td>
</tr>
{{/each}}
</tbody>
</table>Save the template and copy its template ID. The template ID is specific to your PDF.co account and will be used in Make.
Step 2: Create a Make Scenario
Sign in to Make and create a new scenario.
Add the application that will start the workflow. The appropriate trigger depends on where your template data originates.
For example, you could use:
- A custom webhook
- A new Google Sheets row
- A new Airtable record
- A submitted form
- A new order from an e-commerce application
- A scheduled trigger
For a basic test, you can create the PDF.co module first and run the scenario manually with sample data.
Step 3: Add the PDF.co Module
Add another module and select PDF.co.
Choose Convert HTML to PDF as the action.
Do not select Make an API Call. The dedicated conversion module provides the fields required to generate a PDF from an HTML template.
Step 4: Connect PDF.co to Make
If you have not connected PDF.co previously, create a new connection.
Enter a descriptive connection name and provide the API key from your PDF.co dashboard.
Save the connection.
Your API key should be entered only in Make’s connection dialog. Do not place it inside template data, scenario notes, screenshots, or publicly shared workflow examples.
Step 5: Select the Template Conversion Option
In the Convert Options field, select:
HTML Template to PDF
The module will display the fields used for template-based conversion.
Step 6: Enter the Template ID
In the HTML Template ID field, enter or select the ID of the template you saved in PDF.co.
Make sure the template belongs to the PDF.co account associated with the current Make connection. Template IDs from another account may not be available.
Step 7: Add the Template Data
In the Input data in CSV or JSON format field, enter the data that should replace the template placeholders.
For the example template, you could use:
{
"invoice_id": "INV-1001",
"client_name": "Acme Corporation",
"invoice_date": "August 17, 2026",
"total": "$999.00",
"paid": true,
"items": [
{
"name": "Document Processing Service",
"price": "$699.00"
},
{
"name": "Workflow Configuration",
"price": "$300.00"
}
]
}The JSON property names must match the placeholders in the HTML template.
For example:
{{client_name}}is populated by:
"client_name": "Acme Corporation"In a production scenario, you can map values from earlier Make modules instead of entering fixed sample data. Make will insert the mapped values each time the scenario runs.
Ensure that the completed field contains valid JSON. Text values must be enclosed in double quotation marks, and properties must be separated with commas.
PDF.co also accepts template data in CSV format. JSON is generally easier to use when the template contains nested objects, arrays, conditions, or repeating line items.
Step 8: Configure the PDF Output
Configure the remaining PDF options according to your requirements.
Output File Name
Enter a file name such as:
invoice-INV-1001.pdfYou can map the invoice number or another unique value from an earlier module to prevent files from receiving the same name.
Orientation
Select:
- Portrait for vertically oriented documents
- Landscape for wider documents
Portrait is suitable for most invoices and reports.
Paper Size
Select the required page size, such as:
- A4
- Letter
- Legal
Choose the size expected by the document’s recipients.
Render Page Background
Enable this option if the HTML template uses background colors or background images that should appear in the PDF.
Do Not Wait for Full Load
Leave this option disabled for templates that use external fonts, stylesheets, images, or other resources that must finish loading.
Enable it only when faster processing is more important and the template does not rely on resources that require additional loading time.
Margins
Enter custom page margins if the template requires them. Margin values follow this order:
top right bottom leftFor example:
20px 20px 20px 20pxCSS units such as pixels, millimeters, centimeters, and inches can be used.
Execution Mode
Select an execution mode based on the expected processing time:
- Sync: Appropriate for small conversions expected to finish within approximately 10 seconds.
- Async: Recommended for normal asynchronous processing.
- Async for Large Docs: Use for large jobs expected to take more than approximately 30 seconds. Add PDF.co’s Job Check module to retrieve the completed result.
For a small test template, Sync is usually sufficient.
Output Links Expiration
Specify how long the temporary PDF.co output link should remain available. The default is 60 minutes.
The maximum available expiration period depends on the PDF.co subscription plan.
Export Type
Choose how the module should return the PDF:
- Download a File: Returns the PDF as file data that can be passed directly to a storage, email, or upload module.
- JSON Output: Returns processing information and a temporary URL for the generated PDF.
Select Download a File if the next module will upload or attach the PDF. Select JSON Output if the workflow needs the URL or response metadata.
Leave Profiles blank unless you need an advanced PDF.co configuration.
Step 9: Test the Conversion
Save the module configuration and click Run once.
Run the trigger or provide the required sample data.
When the PDF.co module finishes, inspect its output. Depending on the selected export type, the result may include:
- The generated PDF’s temporary URL
- PDF file data
- The output file name
- Page count
- Processing status
- Output-link expiration time
- Job ID
- Credits used
- Remaining credits
Open or download the PDF and confirm that:
- The correct template was used.
- All placeholders were replaced.
- Repeating items were rendered correctly.
- Conditional sections appeared or remained hidden as expected.
- The page size, margins, and orientation are correct.
- Background colors and images appear when required.
If a placeholder remains visible in the PDF, compare its name with the corresponding JSON or CSV property. Placeholder names and input-data property names must match.
Step 10: Save or Deliver the PDF
PDF.co output URLs are temporary, so add another Make module if the generated document must remain available.
For example, you can:
- Upload the PDF to Google Drive, Dropbox, OneDrive, or another storage service.
- Attach it to an email.
- Send it to an electronic-signature workflow.
- Add it to a customer or order record.
- Upload it to another document-management platform.
When Download a File is selected, map the PDF.co module’s Data output to the file-input field of the destination module.
When JSON Output is selected, use the returned URL before its expiration time.
You have created a Make scenario that generates a PDF from a reusable PDF.co HTML template.
The dedicated Convert HTML to PDF module lets you select a template, provide JSON or CSV data, configure the PDF output, and return either downloadable file data or a temporary output URL.
You can now connect this module to forms, spreadsheets, databases, e-commerce platforms, webhooks, and other Make applications to generate personalized invoices, reports, confirmations, certificates, and other PDF documents automatically.
Related Tutorials

