> For the complete documentation index, see [llms.txt](https://docs.empowergpt.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.empowergpt.ai/workflows/block-types/pdf-processor.md).

# 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.empowergpt.ai/workflows/block-types/pdf-processor.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
