Skip to content

Merge PDFs ​

Assembles several PDFs of the run into one, in attachment order: a complete file to attach as a single piece.

Merge PDFs assembles several PDFs of the run into one, in attachment order: the email attachments first, then the files added by the steps. It is the node that turns a sale agreement, its appendices and a generated certificate into ONE file to attach.

The node is only offered when the instance has a documents service.

At a glance ​

  • Type: pdf.merge · version 1
  • Category: Data
  • Kind: Step — one stage of a run
  • Effect: No external effect (none) — nothing is written outside Loop & Roll; safe to replay
  • Needs a carrier email: No
  • Connection: None
  • Inputs: main
  • Outputs: main
The ports of “Merge PDFs”: what comes in on the left, what goes out on the rightInput: main. Outputs: main. An error output appears when its failure setting is “Follow the Error output”.Merge PDFspdf.mergemainmainerror · only with “Follow the Error output”
The ports of “Merge PDFs”: what comes in on the left, what goes out on the right

Parameters ​

selection ​

Attachments to use

  • Type: One choice (options)
  • Required: Yes
  • Default: all
  • Options:
    • all — All attachments: Those of the triggering email, then the files added by earlier steps (a fetched deed, a signed PDF), in that order.
    • first — The first one only: The first attachment, when only one matters.
    • byMime — By file type: By MIME type: application/pdf, or a whole family with image/*.
    • byName — By file name: By name pattern: *.pdf, invoice-*.

mime ​

File type — Exact MIME type (application/pdf) or a whole family (image/*). Left empty, no attachment is kept.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 200 characters at most
  • Example: application/pdf
  • Shown when: selection is byMime
  • Expressions: {{ }} accepted

namePattern ​

File name — Simple pattern: * matches anything, ? one character (*.pdf, invoice-*). Case is ignored.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 200 characters at most
  • Example: *.pdf
  • Shown when: selection is byName
  • Expressions: {{ }} accepted

filename ​

Produced file name — Without extension. May hold fields: file-{{ data.extract.reference }}.

  • Type: Text (string)
  • Required: No
  • Default: "" (empty)
  • 300 characters at most
  • Example: bundle
  • Expressions: {{ }} accepted

Outputs ​

  • main

Data produced ​

What this node adds to the run data, and how to read it in an expression. <step> stands for the step key: the node name turned into an identifier (see Data and expressions).

  • {{ data.<step>.position }} — number. The position of the merged PDF in the run attachments.
  • {{ data.<step>.file }} — { position, filename, mime, size, origin }. The merged PDF, added to the run attachments.
  • {{ data.<step>.pages }} — number. The number of pages of the merged PDF.
  • {{ data.<step>.sources }} — array of { position, filename, mime, size, origin }. The PDFs assembled, in order.
  • {{ data.<step>.summary }} — string. A one-line description for the run detail, in the member's language.

Example ​

selection: byName
namePattern: "*.pdf"
filename: "file-{{ data.extract.reference }}"

Tips ​

  • Two PDFs at least, twenty at most. With a single PDF selected, the step fails with node_nothing_to_do.
  • Password-protected PDFs are refused (document.invalid_document). The bookmarks and metadata of the original PDFs are not kept.
  • The file name is given without extension.

Loop & Roll — the workflow builder for email.