Easily merge multiple PDF documents using the CustomJS API. Great for invoices, reports, and automation.
const { PDF_MERGE } = require('./utils');
const pdfInputs = [...input.files || [],...input.urls || []].filter(i => i);
return PDF_MERGE(pdfInputs);
Make sure that the response type is set to PDF.
This example shows how to merge multiple PDFs by providing their URLs. You can also combine URLs and Base64-encoded strings.
curl -X POST https://e.customjs.io/zeXXXy \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-d '{
"urls": [
"https://css4.pub/2017/newsletter/drylab.pdf",
"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
]
}' --output test-by-urls.pdf
This example shows how to merge multiple PDFs by sending Base64-encoded binary strings. Keep in mind that the payload size is limited to 6 MB. You can also combine Base64 strings with URLs.
curl -X POST https://e.customjs.io/zeXXXy \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY_HERE" \
-d '{
"files": [
"JVBERi0x..........EyNzg3CiUlRU9GCg==",
"JVBERi0x..........EyNzg3CiUlRU9GCg=="
]
}' --output test-by-strings.pdf