Español

Lee este artículo en español.

How to merge PDF files in Make (HTTP module)

If you generate documents with Make (invoices, reports, contracts), sooner or later you need to merge several PDFs into one: the invoice with its terms and conditions, a report with its appendices, or a handful of loose attachments that need to go out as a single file. With the HTTP module and the Cofferdock API, you do it in one step.

An honest heads-up: Make has no dedicated "merge PDF" module. You do it with the generic HTTP module calling an API that combines them in the order you give it.

What you'll get

You send 2 to 20 PDFs (converted to base64) in the order you want them to end up in, and you get back a single PDF with every page in sequence. It costs the same 1 credit whether you merge 2 PDFs or 20.

Common uses in Make:

What you need

Step by step in the HTTP module

Make lets you map the output of any earlier module in the scenario, not just the one right before it, so you can reference the PDFs from two different steps directly (say, module 1 and module 2) with the toBase64() function. Add the HTTP → Make a request module and set it up like this:

{
  "files": ["{{toBase64(1.data)}}", "{{toBase64(2.data)}}"],
  "output": "pdf"
}

The module's output is already the merged file. Wire it straight into Google Drive (Upload a file) or Email as an attachment.

A quick example

Say you generate an invoice and send it with its terms and conditions attached in the same PDF:

  1. An HTTP module that calls the HTML to PDF API and generates the invoice (module 1).
  2. An HTTP module or Google Drive → Download a file that fetches the fixed terms PDF (module 2).
  3. The HTTP module above, which merges both into a single PDF.
  4. An Email → Send an email module that attaches that single PDF for the customer.

The customer gets one file, not two loose attachments.

Prefer to see it in code?

The same call with curl, with the PDFs already in base64:

curl -X POST "https://api.cofferdock.com/pdf-merge?output=pdf" \
  -H "x-api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"files": ["BASE64_PDF_1", "BASE64_PDF_2"]}' \
  -o merged.pdf

How much does it cost?

Each merge uses 1 credit from your plan, whether it's 2 pages or 20. Every Cofferdock tool draws from the same pool of credits.

FAQ

Does Make have a native module to merge PDFs? No. You do it with the generic HTTP module calling the Cofferdock API.

How many PDFs can I merge at once? Between 2 and 20 in the same call.

What order do the pages end up in? The same order they appear in the files array.

Do I need to turn on "Parse response"? No, if you use "output": "pdf" the response is the file itself, not JSON.

Can I get a link instead of the file? Yes. Set output to url and turn on Parse response: you'll get a JSON with a temporary download link (15 minutes).

Related guides

Try it yourself

You'll find the full instructions, with copy-paste examples, on the merge PDF page. And if you don't have an account yet, you can create one for free and build your first scenario today.