Apache PDFBox Extract

Apache PDFBox Extract

Certified

Extract the embedded images of a PDF

Saves every image embedded in the pages of a range, including images inside form XObjects, as PNG files in internal storage. An image reused on several pages is saved once. To bound memory, extraction stops with an error after maxImages images and skips images larger than maxImagePixels.

yaml
type: io.kestra.plugin.pdfbox.image.Extract

Extract the product photos embedded in a catalog

yaml
id: pdf_extract_images
namespace: company.team

inputs:
  - id: file
    type: FILE

tasks:
  - id: images
    type: io.kestra.plugin.pdfbox.image.Extract
    from: "{{ inputs.file }}"

  - id: log
    type: io.kestra.plugin.core.log.Log
    message: "Found {{ outputs.images.count }} images"
Properties

The PDF to read, 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

Last page to read, inclusive

Defaults to the last page.

Default40000000

Largest image to extract, in pixels (width times height)

Bigger images are skipped with a warning. Default 40,000,000, which fits an A4 page scanned at 600 DPI; between 1 and 400,000,000.

Default500

Maximum number of images to extract before failing

Default 500, between 1 and 10,000.

Password of an encrypted PDF

Default1

First page to read, starting at 1

Default 1.

Number of extracted images

SubTypestring

Internal storage URIs of the extracted PNG images