For the complete documentation index, see llms.txt. This page is also available as Markdown.

PDF Processor

The PDF Processor block converts a PDF file into text so that its contents can be used by subsequent blocks in the workflow.

It can process both text-based PDFs and PDFs that require Optical Character Recognition (OCR), such as text in images etc. making the extracted content available for further processing by Agents, Code Blocks, or other workflow blocks.

The PDF Processor accepts one PDF file at a time. If multiple PDF files need to be processed, use the PDF Processor within a Loop.

When to Use the PDF Processor

Use the PDF Processor when your workflow needs to extract text from a PDF before processing its contents.

Common use cases include:

  • Extracting text from PDF documents

  • Processing scanned PDFs using OCR

  • Preparing PDF content for an Agent

  • Summarizing PDF documents

  • Extracting information from invoices, reports, or forms

  • Processing PDF files received from a Form Trigger or another previous block

  • Converting PDFs into text for downstream processing

For example:

Form Trigger → PDF Processor → Agent → Output

A user uploads a PDF through the Form Trigger. The PDF Processor converts the document into text, and the Agent can then summarize or analyze the extracted content.


Configuration

The PDF Processor has a single configuration field:

Configuration

Description

PDF File

References a PDF file provided by a previous workflow block using {{previous_block.file}}. Only one PDF file can be processed per execution of the block.

PDF File

Use the PDF file configuration to select or reference a PDF provided by a previous block in the workflow.

For example, a PDF can be uploaded through a Form Trigger and then passed to the PDF Processor:

Form Trigger – File → PDF Processor

The PDF Processor receives the selected PDF and extracts its textual content.

Note: The PDF Processor accepts only a single PDF file. If the previous block provides multiple PDFs, process them individually using a Loop.


Processing Multiple PDFs

The PDF Processor processes one PDF file at a time.

If your workflow receives multiple PDFs, use a Loop to process each PDF individually.

For example:

Form Trigger – Multiple Files ↓ Start Loop ↓ PDF Processor ↓ Agent ↓ End Loop

Configure the Array to Loop Over using the collection of PDF files received from the previous block.

During each iteration:

  1. The Loop selects the current PDF.

  2. The PDF Processor processes that PDF.

  3. The PDF is converted into text.

  4. The next block processes the extracted text.

  5. The Loop moves to the next PDF.

Recommended: Always use a Loop when multiple PDF files need to be processed, since a single PDF Processor block accepts only one PDF at a time.


Example: Summarize a PDF

A simple PDF summarization workflow can be configured as:

Form Trigger → PDF Processor → Agent → Output

1. Form Trigger

Add a File field where the user can upload the PDF.

2. PDF Processor

Reference the PDF uploaded through the Form Trigger.

The PDF Processor extracts the document's text, using OCR where required.

3. Agent

Pass the extracted text to the Agent and configure a prompt such as:

Summarize the extracted document. Identify the main topics, key information, and important conclusions.

4. Output

Pass the Agent's generated summary to the Output Block.

The complete process is:

PDF Upload → Text Extraction/OCR → AI Processing → Summary


Best Practices

Provide a PDF file The PDF Processor is specifically designed to process PDF files. Make sure the referenced output from the previous block contains a PDF.

Use a Loop for multiple PDFs Do not pass multiple PDF files directly to a single PDF Processor. Use a Loop and process each PDF individually.

Place the PDF Processor before text-based processing When an Agent or another block needs the textual contents of a PDF, use the PDF Processor first to extract the text.

Use OCR for scanned documents The PDF Processor can extract text from scanned or image-based PDFs using OCR.

Test with representative documents PDFs can vary significantly in structure and content. Test your workflow with the types of PDFs you expect users to provide.

Last updated

Was this helpful?