Apache PDFBox Merge

Apache PDFBox Merge

Certified

Merge several PDFs into one

Appends the pages of each input PDF, in the order given, into a single PDF stored in internal storage. Inputs must not be encrypted; decrypt them first with security.Decrypt.

yaml
type: io.kestra.plugin.pdfbox.document.Merge

Merge two PDFs and password protect the result

yaml
id: pdf_merge_encrypt
namespace: company.team

inputs:
  - id: first
    type: FILE
  - id: second
    type: FILE

tasks:
  - id: merge
    type: io.kestra.plugin.pdfbox.document.Merge
    files:
      - "{{ inputs.first }}"
      - "{{ inputs.second }}"

  - id: encrypt
    type: io.kestra.plugin.pdfbox.security.Encrypt
    from: "{{ outputs.merge.uri }}"
    userPassword: "{{ secret('PDF_USER_PASSWORD') }}"
    ownerPassword: "{{ secret('PDF_OWNER_PASSWORD') }}"
Properties
SubTypestring

The PDFs to merge, as internal storage URIs, in page order

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
Default100

Maximum number of PDFs to merge

Default 100, between 2 and 10,000.

Default10000

Maximum number of pages in the merged PDF

Checked from each input before merging, so the task fails early instead of building a huge document. Default 10,000, between 1 and 100,000.

Number of pages in the merged PDF

Formaturi

Internal storage URI of the merged PDF