Actions3
Merge PDFs
AI-generatedSummary
Merge multiple PDF files from input items into a single PDF output, optionally selecting specific pages from each input PDF.
Inputs
- Binary Field (required) — The name of the binary field in each input item containing the PDF data to merge (default: 'data').
- Pages Per Item (required) — Choose to include all pages from each input PDF or specify pages per item via expression.
- Pages — If 'Select Pages Per Item' is chosen, specify pages to include from that PDF using a comma-separated list and ranges (e.g., '1,3,5-8'). Pages are 1-based.
- Output Field Name (required) — The name of the binary field to write the merged PDF to (default: 'data').
- Output File Name (required) — The filename for the merged PDF output (default: 'merged.pdf').
Output shape
a single item containing a binary field with the merged PDF
The output binary field contains the merged PDF file. The JSON part includes metadata: pdfMerged (true), inputFiles (number of input PDFs merged), and pageCount (total pages in merged PDF). Errors throw exceptions unless continueOnFail is enabled, in which case error info is returned in JSON.
Examples
Example 1: Merging two PDFs selecting all pages
Set Binary Field to 'data' (or your PDF binary field), select 'All Pages' for Pages Per Item, and leave other defaults. Input items each contain one PDF binary. The node merges all pages from both into one PDF.
Example 2: Merging PDFs with selected pages per input
Set Binary Field as needed, choose 'Select Pages Per Item' for Pages Per Item, and use an expression in the Pages field per item to indicate pages to extract (e.g. '1,3-4'). The node merges only those pages from each PDF item.