// make.com integration

Merge Multipe PDFs

Merging multiple PDFs into a single document can be a time-consuming task, but CustomJS makes it easy and efficient. In this example, HTML strings are first converted into PDFs using the HTML2PDF function and then merged into a single document using the PDF_MERGE function.

This approach allows you to dynamically generate PDFs from HTML content and combine them seamlessly. It is perfect for automating PDF creation and merging in various workflows and saves both time and effort in your processes.

To optimize the process, we perform the merge asynchronously, to ensure that the task is completed faster, the PDFs are generated in parallel.
Merge Multiple PDFs With Make.com
Merge Multiple PDFs With Make.com
const { PDF_MERGE, HTML2PDF } = require('./utils');

let pages = [
    input.page1,
    input.page2,
    input.page3,
    input.page4,
    input.page5,
    input.page6,
    input.page7,
    input.page8,
    input.page9,
    input.page10,
    input.page11
];

pages = await Promise.all(pages.filter(i => i).map(i => HTML2PDF(i)));

// Optional: custom page size in mm (defaults to A4 210×297mm when omitted)
// pages = await Promise.all(pages.filter(i => i).map(i => HTML2PDF(i, { pdfWidthMm: 210, pdfHeightMm: 297 })));

return PDF_MERGE(pages);
Merge multiple PDFs With Make.com
Merge multiple PDFs With Make.com

Related Articles

Continue reading on similar topics

PDF Generation in Power Automate: Complete Guide 2025
·Guide

PDF Generation in Power Automate: Complete Guide 2025

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.

power-automatepdfhtml-to-pdf