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.
import { PDFEngines, PdfFormat } from "chromiumly";

const buffer = await PDFEngines.merge({
  files: ["path/to/file_1.pdf", "path/to/file_2.pdf"],
  pdfa: PdfFormat.A_2b,
  pdfUA: true,
});
Optional pdfa and pdfUA convert the merged result to PDF/A and/or PDF/UA. See Reference — PDFEngines.