> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chromiumly.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Merge PDFs

> Merge multiple PDF files into one with PDFEngines.merge.

`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](https://gotenberg.dev/docs/manipulate-pdfs/merge-pdfs), which can use PDFtk, PDFcpu, QPDF, or UNO.

```typescript theme={null}
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](/reference/pdf-engines).

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](/pdf-engines/rotate) and [Watermark and stamp](/pdf-engines/watermark-stamp).
