HubSpot PDF API: 3 Ways to Generate PDFs From Your CRM Data
Generate branded PDFs - invoices, NDAs, quotes, certificates - straight from HubSpot data. Three approaches, from a free no-code link to fully automated workflows. 600 free PDFs/month.
// make.com integration

Parameters — Define dynamic parameters in the CustomJS platform (these will also appear automatically as input fields in Make.com).
Template — Insert these parameters into an HTML invoice template, which is rendered with the Nunjucks templating engine.
Storage/Editing — Store the template as a static HTML variable, so you can edit it in the CustomJS HTML editor.
Output — Generate the final output as a PDF, which you can use in Make.com or trigger externally via the CustomJS API.
The following script replaces variables in the HTML template with Nunjucks and generates the PDF.
const { HTML2PDF } = require("./utils");
const nunjucks = require("nunjucks");
const content = nunjucks.renderString(variables.Template, {
currency: "€",
items: JSON.parse(input.items),
taxRate: 19,
subTotal: input.subTotal,
taxAmount: input.taxAmount,
total: input.total,
invoiceNumber: input.invoiceNumber,
createdDate: input.invoiceDate,
dueDate: input.invoiceDueDate,
companyLogo: "https://beta.customjs.space/customJS-logo.png",
sender: {
name: "Technology Circle GmbH",
address1: "Karolinenstraße 24 Haus 4",
address2: "20357 Hamburg",
iban: "IBAN SAMPLE",
bic: "BIC SAMPLE"
},
receiver: {
name: input.clientName,
address1: input.clientAddress1,
address2: input.clientAddress2,
tax: input.clientTax,
},
footerText: "2025© TechnologyCircle",
});
return await HTML2PDF(content);
You can optionally set a custom page size (in millimeters). If you omit both, the default is A4 (210×297mm).
return await HTML2PDF(content, { pdfWidthMm: 210, pdfHeightMm: 297 });
Here’s how the full function looks inside CustomJS.


This is the HTML code of the Invoices. You can find the import code in the invoice.html.

Continue reading on similar topics
Generate branded PDFs - invoices, NDAs, quotes, certificates - straight from HubSpot data. Three approaches, from a free no-code link to fully automated workflows. 600 free PDFs/month.
Generate professional PDFs in Power Automate with CustomJS. Create invoices, receipts, reports, and certificates with custom HTML templates, QR codes, and advanced formatting. No Azure Functions required.
Create professional HTML receipt templates that convert perfectly to PDF. Use our free receipt PDF generator or choose from 5 customizable templates for e-commerce, SaaS, and service businesses.