If your invoice layout already exists as HTML and CSS, rebuilding it as a Word document to automate it is work nobody should have to do twice. Keep the HTML. This walkthrough fills it with data and turns the result into a PDF, in Make, with PDF4me Generate Document and PDF4me Convert HTML to PDF. Five modules, two of which feed one action, and an Output Type field that will not give you a PDF no matter how much you want it to.
Dropbox module reading invoice_template.html, the layout.
Dropbox module reading invoice_data.json, the values.
PDF4me module. Template File Type Html, Output Type Html, template from the File picker, data from Document Data File.
PDF4me module. File set to the Generate module, Layout Portrait.
Dropbox module. Folder /pdf4meoutput, from the Convert module.
Two Dropbox Download a File modules fetch the HTML template and the JSON data. PDF4me Generate Document takes Template File Type Html, Output Type Html, its File picker set to the template download, Document DataType Json, and Document Data File mapped to the data download's Data. PDF4me Convert HTML to PDF then renders that HTML on Layout Portrait, and Dropbox Upload a File writes the PDF to /pdf4meoutput. Five modules, five operations, one PDF.
Output Type on the Generate module offers nothing but Html when the template is HTML. That is why this scenario has a fourth module. Leave Output Type on Html and let Convert HTML to PDF produce the file you actually send.
Why-Based Q&A
It looks as though it should. Generate Document needs the template from module 1 and the data from module 2, and the File picker only takes one module. The answer is that the data is not part of the file group at all: Document Data File is its own field, mapped directly. So the picker handles the template, the data field handles the data, and the Map toggles you can see on screen belong to Template File Type, Output Type and Document DataType, all left off.
PDF4me reads the template format from the extension on the name. Picking the template download in the File field carries invoice_template.html across with the bytes, which matches Template File Type Html. The two have to agree, which is the argument for letting the picker supply the name rather than typing one.
Because the two downloads look identical in the mapping panel, both offering File Name and Data. Mapping the template's Data into Document Data File feeds the layout to itself as data, and the run produces a document with every placeholder empty. Check the module number on the token before you save.
Generate Document is the singular module: one template, one data payload, one document back. The plural Generate Documents returns an array and does need an Iterator. Adding one here would sit between two modules that are already passing a single document.
What You'll Get
Input: an HTML template and a JSON data file, both in cloud storage. This scenario reads /pdf4metest/GenerateDocumentFromHtml/invoice_template.html and /pdf4metest/GenerateDocumentFromHtml/invoice_data.json. Output: one PDF invoice in /pdf4meoutput, carrying the styling from the HTML.
The completed run

What You Need
- A Make account with a scenario you can edit.
- A PDF4me API key. Open the PDF4me dashboard and create one.
- A storage connection. This scenario uses Dropbox, authenticated by you.
- An HTML template with placeholders written in mustache syntax. Self contained HTML renders most predictably, so inline the CSS.
- A JSON data file whose structure matches what the template reads.
The Scenario at a Glance
- Dropbox: Download a File, the HTML template.
- Dropbox: Download a File, the JSON data.
- PDF4me: Generate Document, template from the picker, data from its own field.
- PDF4me: Convert HTML to PDF, producing the PDF.
- Dropbox: Upload a File, to
/pdf4meoutput.
Step 1: Dropbox, Download the HTML Template
Flow so far: Download a File.
- Create a new scenario and click the first + on the canvas.
- Search Dropbox and pick Download a File.
- Configure:
- Way of selecting files:
Select a file - File:
/pdf4metest/GenerateDocumentFromHtml/invoice_template.html
- Way of selecting files:
Template download configuration

Step 2: Dropbox, Download the JSON Data
Flow so far: Download a File, Download a File.
- Add a second Dropbox: Download a File after the first. The scenario stays one straight chain.
- Configure:
- Way of selecting files:
Select a file - File:
/pdf4metest/GenerateDocumentFromHtml/invoice_data.json
- Way of selecting files:
Data download configuration

The data for this template is shaped around a Documents array, with a header, a body holding the invoice, biller and recipient blocks and a repeating Product array, and a footer. Abridged below to one line item, with the invoice instructions field and the fax and web entries removed, and the sample addresses replaced:
{
"Documents": [
{
"header": { "docType": "Original Copy" },
"body": {
"Column1": "Quantity",
"Column2": "Description",
"Column3": "Unit Price",
"Column4": "Total",
"Invoice": {
"number": 14957,
"date": "25-02-2022",
"subTotal": 200150,
"tax": "18%",
"dueDate": "25-03-2022",
"shipping": "200"
},
"Biller": {
"phone": "989797",
"address": { "company": "Organization 1", "street": "Street 1", "city": "City 1", "zip": "123456" }
},
"Recepient": {
"name": "recepeint 1",
"address": { "street": "testveien 3", "city": "City 1", "zipcode": "0555", "country": "Country 1" }
},
"Product": [
{ "quantity": 1, "description": "item 1", "unitPrice": 45, "totalPrice": 867 }
]
},
}
]
}
Step 3: PDF4me, Generate Document
Flow so far: Download a File, Download a File, Generate Document.
Two upstream modules feed this one, and they arrive through different fields: the template through the File picker, the data through Document Data File.
- Add PDF4me: Generate Document.
- Connection: click Add and paste your PDF4me API key.
- Configure:
- Template File Type:
Html - Output Type:
Html - File: choose
Dropbox - Download a File, the template download - Document DataType:
Json - Document Data File: map Data from the data download
- Document Data Text: leave empty
- Template File Type:
Generate Document configuration, upper half

Generate Document configuration, lower half

| Field | Comes from | Why |
|---|---|---|
| File | the template download, via the radio picker | Carries invoice_template.html and its bytes together |
| Document Data File | Data of the data download, mapped | The values, as binary, in a field of its own |
| Document Data Text | nothing | The alternative to the file, not a companion |
| Template File Type | literal Html | Declares what the template is |
| Output Type | literal Html | The only value an HTML template allows |
| Document DataType | literal Json | Declares what the data is |
Step 4: PDF4me, Convert HTML to PDF
Flow so far: Download a File, Download a File, Generate Document, Convert HTML to PDF.
Only one module needs to feed this one. The File list still shows both Dropbox downloads and Map alongside Generate Document, so pick deliberately.
- Add PDF4me: Convert HTML to PDF.
- Configure:
- File: choose
PDF4me - Generate Document - Layout:
Portrait
- File: choose
Convert HTML to PDF configuration

Step 5: Dropbox, Upload a File
Flow so far: Download a File, Download a File, Generate Document, Convert HTML to PDF, Upload a File.
- Add Dropbox: Upload a File.
- Configure:
- Folder:
/pdf4meoutput - File: choose
PDF4me - Convert HTML to PDF - Leave Show advanced settings off. Overwrite an existing file sits behind it and stays at its default, so a second run does not replace the first file.
- Folder:
Upload a File configuration

Dropbox stores whatever file it is handed, so a token pointing at module 3 files the intermediate HTML instead. Check that the token in File names module 4.
Run the Scenario and Verify
Press Run once, then open the PDF and read it against the JSON.
A scenario that merges a JSON payload into an HTML invoice layout, renders the result as a PDF, and files it. Five modules, five operations per run. Check that every placeholder is filled and that the styling survived the render, because an external stylesheet the renderer could not reach produces a correct but unstyled invoice.
Common Variations You Can Add Without Rebuilding
Generate Documents takes a data file holding many records and returns an array, which then needs an Iterator.
Generate Document Using Template works from a stored .docx and skips the rendering step.
Add a second upload mapped to module 3, so the scenario files both the HTML and the PDF.
Replace module 5 with a mail module and the invoice goes out as an attachment instead of into storage.
Common Questions
How do you create an invoice template in HTML?
Build the layout in HTML and CSS as you would a web page, then put a mustache placeholder wherever a value belongs. Inline the CSS so the renderer does not have to fetch anything, and keep the structure of your JSON in mind as you name the fields.
How do you make an invoice bill in HTML automatically?
Store the layout and the data separately, then let PDF4me merge them. Generate Document produces the filled HTML and Convert HTML to PDF turns it into the file you send.
Why use an HTML template rather than Word?
Because the design already exists. A billing page or a web receipt that was built in HTML can be reused as the invoice layout without redrawing it in a word processor, and CSS gives finer control over spacing and type than a .docx does.
When should you use a Word template instead?
When the people who maintain the layout work in Word, or when the output needs to stay editable as a document. The Word route also skips a module, because a .docx template can produce a PDF directly.
How do you generate invoices for your business from this?
Replace the fixed JSON path with whatever holds your billing data, a Make data store, a database module, or a webhook from your billing system, and leave the rest of the scenario as it is. The template and the rendering do not change.
Troubleshooting
Document Data File is mapped to the template download instead of the data download. The two look identical in the mapping panel, so check the module number on the token.
That is correct behaviour for an HTML template. Leave it on Html and add Convert HTML to PDF as the next module.
The template links a stylesheet the renderer could not fetch. Inline the CSS and embed images as data: URIs so the template is self contained.
Module 5 is mapped to Generate Document rather than to Convert HTML to PDF, and the scenario goes green either way. Check that the token in its File field names module 4.
Next Steps
Every field on the module.
The rendering step, on its own.
One module shorter, with the template stored in PDF4me.
The plural module, with an Iterator.
Point modules 1 and 2 at your own template and data, run it once against a single record, and open the PDF before you wire anything that produces invoices in bulk.
