Skip to main content

Extract Images

Extracts images from a PDF document and saves them as image files.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • PDF File Path - The path to the PDF file from which images will be extracted.

Options

  • Output Directory - The directory where the extracted images will be saved.
  • Password - The password for the PDF document if it is encrypted.
  • Export Type - The format to save the extracted images. Options depend on the system's supported image formats.
  • Prefix - A prefix to add to the filenames of the extracted images.

Output

  • result - The result of the image extraction operation.

How It Works

The Extract Images node scans a PDF document and extracts all embedded images, saving them as separate image files. When executed, the node:

  1. Validates that the input PDF path is not empty
  2. Checks that the output directory exists
  3. Validates that an export type is specified
  4. Loads the PDF document (using the password if provided)
  5. Iterates through all pages of the document
  6. Extracts images from each page's resources
  7. Saves each extracted image to the output directory with the specified format and prefix
  8. Closes the document

Requirements

  • A valid PDF file path
  • An existing output directory
  • A valid export type for image format
  • Sufficient permissions to read the input file and write to the output location

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid PDF File Path
  • Output directory does not exist
  • Export type is not specified
  • File I/O errors
  • PDF processing errors

Usage Notes

  • The extracted images will be numbered sequentially (1, 2, 3, etc.)
  • If a prefix is specified, it will be added to the beginning of each filename
  • The node can extract images from password-protected PDFs when the correct password is provided
  • Supported export types depend on the system's image I/O capabilities