Apache PDFBox Split

Apache PDFBox Split

Certified

Split a PDF into several PDFs

Splits by explicit page ranges (ranges) or into chunks of everyNPages pages. Each part is stored in internal storage; the output lists them in order. The parts are not encrypted, so an encrypted input needs its owner password.

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

Split a PDF into one file per page

yaml
id: pdf_split_pages
namespace: company.team

inputs:
  - id: file
    type: FILE

tasks:
  - id: split
    type: io.kestra.plugin.pdfbox.document.Split
    from: "{{ inputs.file }}"
    everyNPages: 1

Keep the cover page and the appendix as separate files

yaml
id: pdf_split_ranges
namespace: company.team

inputs:
  - id: file
    type: FILE

tasks:
  - id: split
    type: io.kestra.plugin.pdfbox.document.Split
    from: "{{ inputs.file }}"
    ranges:
      - "1"
      - "10-14"
Properties

The PDF to split, as an internal storage URI

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

Split into chunks of this many pages

The last chunk holds the remaining pages. Set either ranges or everyNPages.

Default1000

Maximum number of parts to write

The task fails instead of writing more parts than this, so a very long document split page by page cannot fill the worker's storage. Default 1,000, between 1 and 100,000.

Owner password of an encrypted PDF

The parts are written unencrypted, so the user password alone is refused.

SubTypestring

Page ranges to extract, one output PDF per entry

Each entry is a single page (3) or an inclusive range (3-7), pages numbered from 1. Set either ranges or everyNPages.

Number of parts

SubTypestring

Internal storage URIs of the parts, in order