A Make scenario usually already holds everything an invoice needs: the customer, the lines, the totals. This template adds the one module that turns that bundle into a PDF, and keeps the layout in a template you can edit rather than in a module setting.
600 free requests / month, no credit card
// live preview
The left pane is the HTML the module receives, the right pane is the data your scenario maps into it. Change either one and render: this is the same endpoint the Make module calls.
// the workflow
The scenario is deliberately short. Whatever already produces the invoice data stays as it is, the CustomJS module renders it, and the last module does something with the file. Point the module at a Text field holding the rendered HTML, or let the template engine do the filling for you.
{
"html": "<!DOCTYPE html> ... the template above ... ",
"data": {
"invoiceNumber": "{{1.invoice_number}}",
"customer": { "name": "{{1.customer_name}}" },
"items": "{{1.line_items}}"
},
"config": { "pdfWidthMm": 210, "pdfHeightMm": 297 }
}// step by step
Add the module to a scenario and create a connection with the API key from your workspace. The getting started page walks through it once, and every later scenario reuses the connection.
Search for CustomJS in the module picker and pick HTML to PDF. It is the module documented on the PDF generation page.
Put the HTML in the module and map your scenario fields into the data. Make bundles map straight onto the placeholders, and an array of line items becomes the repeating rows without an iterator.
Leave pdfWidthMm and pdfHeightMm empty for A4. Set both for a label, a receipt roll or US Letter at 216 by 279.
The module returns a binary buffer, so the next module can attach it to a Gmail message, upload it to Google Drive or push it to your own API. No temporary file is written in between.
// html template
The placeholders are template tags, not Make formulas, which means the layout stays readable and the same HTML works from any platform. The loop over the line items is the part worth understanding.
<tbody>
{% for item in items %}
<tr>
<td>{{ item.description }}</td>
<td class="num">{{ item.quantity }}</td>
<td class="num">{{ item.unitPrice }}</td>
<td class="num">{{ (item.quantity * item.unitPrice).toFixed(2) }}</td>
</tr>
{% endfor %}
</tbody>{
"items": [
{ "description": "{{1.name}}", "quantity": {{1.qty}}, "unitPrice": {{1.price}} }
]
}If the array arrives as a string from a previous module, parse it first. The JSON parameter guide covers the shapes Make hands over.
Turn invoice data from any n8n node into a finished PDF with one CustomJS node. Importable workflow, editable HTML template, no headless browser to run.
A Zap that renders an invoice PDF from the fields of the trigger step, including line items, and hands the file to Gmail or Drive.
A thermal receipt sized for an 80mm roll, rendered from a Make scenario. Monospace layout, VAT split, printable or emailed as a PDF.
Create a workspace, copy the API key into the Make connection, and the module is ready.