Skip to main content

HTML template in Make

The HTML template family is a Make Generate Document Single option that renders an .html layout into a finished document. It merges mustache tags, such as a recipient name field and a line-item loop, with your JSON data and outputs a PDF or HTML file. It suits teams that already maintain HTML or email templates.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog →

Before You Start​

HTML template with mustache tags
The sample invoice_sample_1.html is a full invoice layout with nested paths and a subInfo line-item loop. Paths must match your JSON structure exactly.
Matching data file
Use invoice_sample_data_1.json (recommended), test.xml, or test.csv. JSON uses nested objects and a subInfo array.
PDF4me connection in Make
Create a PDF4me connection in Make and paste your API key. The same key works across every PDF4me module in your scenario.

Sample File Pack​

Download the files below. One HTML template plus matching data in JSON, XML, and CSV.

Make PDF4me Generate Document Single module. Connection is set to a PDF4me account. Template File Type is PDF4me Word Template. Output Type is Word. File source is Map with Template Name mapped from previous step File Name and Template mapped from previous step Data. Document DataType is Json and Document Data Text shows an inline JSON object with Name, Age, and Birth fields. Document Data File and Meta Data Json are empty.

Target configuration: PDF4me HTML Template + JSON in Document Data Text + PDF output.

What is the HTML template template in Make?​

The HTML template family renders a browser-style .html layout with inline CSS into a document. Placeholders written in mustache syntax are substituted from your data, and the loop block {{#each subInfo}} repeats a table row per line item. Choose it for marketing PDFs and brand-styled invoices your team already maintains as HTML.

How do I configure HTML template in Make?​

Set the module fields as below. Required fields are marked with a red asterisk in the Make UI.

ParameterRequiredWhat it doesExample
ConnectionRequiredPDF4me connection for the scenario. Click Add to create one with your API key.My PDF4me connection
Template File TypeRequiredSet to Html for this template family. Options: PDF4me Word Template, Html, Mail Merge, Google Docs, Pdf Form. Defaults to PDF4me Word Template.Html
Output TypeConditionalFormat of the generated document. The Html template family offers Html only. Defaults to Html.Html
FileRequiredHow the template file reaches the module. The radio lists your connected storage actions (for example Dropbox - Download a File) and Map. Choose Map to wire the fields below from earlier modules: Template Name, Template and Document Data File only appear once Map is selected.Map
Template NameRequiredTemplate file name including extension. Map from the prior module file name output.invoice_sample_1.html
TemplateRequiredTemplate file binary. Map from the prior module data output (for example 1. Data from Dropbox Download a File).1. Data
Document DataTypeRequiredFormat of the data payload. Options: Json, XML, Csv. Defaults to Json.Json
Document Data TextOptionalInline JSON or XML data. Use when Document Data File is empty.invoice_sample_data_1.json
Document Data FileOptionalMapped data file from a prior module. Use when Document Data Text is empty.1. Data
Meta Data JsonOptionalOptional JSON describing advanced field settings for the template.

Output​

The module returns one bundle per run. The generated file is placed on the Document output field. PDF4me may process the request as a background job, and Make waits for the result before the next module runs.

FieldTypeWhat it contains
File NameFile nameOutput filename based on Template Name with the extension matching Output Type.
DocumentFile (binary data)The generated document. Map into a downstream Upload File or Send Email Attachment module.

Production patterns​

Common Make patterns for HTML templatesReplace the manual test with these once the sample works.
Template from cloud storage
  1. Dropbox or Google Drive stores invoice_sample_1.html.
  2. Download a File loads the template as binary.
  3. Generate Document Single maps Template Name and Template.
  4. Data is built from Sheets or a webhook as JSON.
Webhook to delivered PDF
  1. Webhook receives the record payload.
  2. Generate Document Single merges it with the template.
  3. Output Type is PDF.
  4. Send Email or Upload File delivers Document.
Batch from a data source
  1. Search Records returns many rows.
  2. Iterator loops one record at a time.
  3. Generate Document Single runs once per record.
  4. Each file is uploaded to a per-record folder.

Frequently Asked Questions​

Can HTML templates output a PDF in Make?+
Yes. Set Output Type to PDF for a print-ready file, or HTML for an email body or web preview. The same invoice_sample_1.html renders either way.
How do line items work in the sample?+
The subInfo array in the JSON drives the each subInfo block in the HTML table. Each object renders one row with plan, quantity, vat, and totalPrice. Add or remove array items to change the row count.
Why does test.csv have two rows?+
CSV flattens nested data. Each row is one line item while repeating the shared invoice fields such as recipient and dates. Both rows share the same totalAmount.
JSON, XML, or CSV: which should I use?+
JSON is best because it matches the nested mustache paths and the subInfo array. XML uses PascalCase elements. CSV suits spreadsheet exports but uses flattened column names.

For the underlying template engine, see the Aspose Words for .NET documentation and the Make data structures reference.