Generate Invoice PDFs in Make.com

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

Document
Invoice
Platform
Make.com
Modules
3
Output
PDF, binary buffer

// live preview

Edit the template, render the invoice

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

Three modules, start to PDF

Airtable, Stripe, HTTP
whatever holds the invoice
CustomJS
HTML to PDF
Gmail, Drive, Dropbox
send or store the file

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.

What the module receives

{
  "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

Build it yourself

  1. 1

    Connect the CustomJS app in Make

    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.

  2. 2

    Add the HTML to PDF module

    Search for CustomJS in the module picker and pick HTML to PDF. It is the module documented on the PDF generation page.

  3. 3

    Paste the template, map the data

    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.

  4. 4

    Set the page size if you need one

    Leave pdfWidthMm and pdfHeightMm empty for A4. Set both for a label, a receipt roll or US Letter at 216 by 279.

  5. 5

    Do something with the file

    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

How the template fills itself

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.

Repeating line items

<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>

Mapping a Make array into it

{
  "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.

Questions about this template

Put this in your scenario

Create a workspace, copy the API key into the Make connection, and the module is ready.