Skip to main content

PDF To Image

Controlled node

Overview

Converts a specific page of a PDF document into a Jimp image object that can be processed by other image manipulation nodes in the workflow. This node renders the specified page as a bitmap image, enabling visual analysis, resizing, or AI-powered image processing of PDF content.

Inputs

InputTypeDescriptionDefault
RunEventTriggers the PDF to image conversion.-
FileDataThe PDF file to convert. Accepts a file object from the library (max 1 file).-
Page IndexNumberThe zero-based index of the page to render (0 = first page).0

Outputs

OutputTypeDescription
OutputDataA Jimp image object containing the rendered PDF page. Compatible with all image processing nodes.
DoneEventFires when the conversion is complete and the image is ready.

Runtime Behavior and Defaults

  • Page Index: If not provided or invalid, defaults to 0 (the first page of the PDF). Use 0 for page 1, 1 for page 2, etc.
  • File Handling: The node expects a single PDF file from the library. If an array of files is provided, only the first file is processed.
  • Image Format: The output is a Jimp image object (bitmap) compatible with all image processing nodes such as Resize Image, Crop Image, Greyscale Image, and AI Vision Write.
  • Temporary Storage: During execution, temporary image files are created in storage and automatically cleaned up after the image is loaded into memory.
  • Error Handling: Returns an error object in the output if:
    • No project ID is available in the runtime context
    • The file is missing or invalid
    • The PDF rendering service fails
    • The resulting image cannot be read

Example Usage

Use this node when you need to perform image-based operations on PDF content, such as visual analysis or preprocessing before OCR.

Example workflow:

  1. StartRead PDF (select PDF from library) → PDF To Image (pageIndex: 0)
  2. PDF To ImageResize Image (width: 1024, height: 1024) → AI Vision Write (prompt: "Extract all text from this document image")

This workflow converts the first page of a PDF to an image, resizes it for optimal AI processing, and then uses a vision model to extract text content.