Skip to main content
transform.merge-documents combines a list of files into a single PDF run output, in the order given. Use it when one logical document arrives as several uploads (a scan split into one file per page, or a packet sent as separate PDFs and photos). Parse the merged file once and every downstream page index (Label Pages, Split, Separate Documents, Vision pageIndices) counts across all sources instead of restarting at 0 for each file. Downstream file steps take the merged PDF from file: {{ steps.merge.output.file }}. The rest of the output describes the pages.
A single file is accepted too, so the same workflow handles one upload or many.

Accepted files

Any other type fails the step with the filename and type in the error. When a file arrives as application/octet-stream, its type is recovered from the filename extension or the file contents. At most 100 files are merged per step. All files together can be at most 256 MiB.

Mapping pages back to files

sources lists every input file in merge order with the 0-based, inclusive page range it occupies in the merged PDF. A page index from Label Pages or Vision maps back to its file by finding the range that contains it, for example in a transform.script step:

Configuration

Configuration goes inside the step’s with: block.
string
required
Template expression resolving to the files to merge, in order: a file list input such as {{ input.documents }}, or a single file. PDF, images (JPEG, PNG, TIFF, WebP, GIF) and Word, PowerPoint, OpenDocument or RTF documents.
string
Filename of the merged PDF. Defaults to merged.pdf; .pdf is appended when missing.

Output

The merged PDF. Pass {{ steps.<step>.output.file }} to Parse, Vision or any other file input.
Total pages in the merged PDF
One entry per input file, in merge order, with the merged page range it occupies. Use it to map a merged page index back to its source file.