Merge PDFs
merge_pdfsConcatenate 2 to 50 PDFs into a single document. Signatures and AcroForms are automatically stripped; link annotations remain unless explicitly dropped.
Instructions
Concatenate 2–50 source PDFs into a single document (pdfnative v1.4 page-tree API). Each kept page's object graph is deep-copied into a fresh, self-contained PDF. Signatures and AcroForms are dropped (a page-tree edit invalidates /ByteRange); self-contained URI link annotations are preserved unless dropAnnotations=true. Encrypted sources are rejected (ENCRYPTED_SOURCE) — decrypt first. A secure-by-default 256 MiB in-memory assembly guard (maxOutputSizeBytes) guards against memory exhaustion; the emitted PDF is separately capped at 50 MiB (OUTPUT_TOO_LARGE). Returns one PDF (base64 or sandboxed file).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| outputMode | No | base64 | |
| outputPath | No | ||
| pdfsBase64 | Yes | Base64-encoded source PDFs to concatenate, in order. 2–50 documents. Signatures and AcroForms are dropped (a page-tree edit invalidates them); encrypted PDFs are rejected. | |
| dropAnnotations | No | When true, drop ALL annotations. Default (false) keeps self-contained URI link annotations and drops cross-document/widget annotations. | |
| maxOutputSizeBytes | No | In-memory assembly guard (pdfnative maxOutputSize): the merge throws before materialising an object graph larger than this. Defaults to 268435456 (256 MiB). Note the emitted PDF is separately capped at 50 MiB by the output layer. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| filePath | No | Absolute sandboxed file path (when mode='file'). | |
| sizeBytes | Yes |