Skip to main content
PDFEngines.merge() combines multiple PDFs into a single file. The merged PDF order follows the alphanumeric order of the input filenames (numbers first, then alphabetical). It uses Gotenberg’s merge route, which can use PDFtk, PDFcpu, QPDF, or UNO.
Optional pdfa and pdfUA convert the merged result to PDF/A and/or PDF/UA. Optional metadata writes metadata to the merged PDF, and flatten flattens its form fields and annotations. See Reference — PDFEngines. Optional bookmarks sets a final bookmark list on the merged PDF, or a filename-keyed map applied to each input before merging (its page indexes get offset automatically). Optional autoIndexBookmarks instead auto-extracts and offsets each input’s existing bookmarks — bookmarks and autoIndexBookmarks are mutually exclusive strategies for the merged PDF’s outline. Optional userPassword/ownerPassword and the six permission booleans (allowPrinting, allowCopying, allowModifying, allowAnnotating, allowFillingForms, allowAssembling) encrypt the merged output — see Encryption and PDF permissions. You can also pass watermark and/or stamp to apply PDF-engine overlays during merge. Optional rotate ({ angle: 90 | 180 | 270; pages?: string }) runs a PDF-engine rotation pass after merge. See Rotate PDFs and Watermark and stamp. downloadFrom, webhook, outputFilename, and trace are also accepted — see Request tracing.