---
title: PDF Parser
description: Extract text from a PDF
---

Extract the text from a PDF, as one string or one string per page.

## What it does

PDF Parser reads a PDF held in a field of the incoming item and returns its text and its number of pages. The PDF can be a base64 string, a `data:` URL with base64 content, or raw bytes. Everything happens in your browser; the file is not uploaded.

With **Merge pages** on, you get the whole document as one string. Turn it off to get a list with one string per page.

## When to use it

* Summarise or question a PDF with an AI node, using its text.
* Search a PDF's text with [Regex](/nodes/builtin/datatransformation/regex/), for example to find an invoice number.
* Handle each page separately: turn **Merge pages** off, then use [Split Out](/nodes/builtin/datatransformation/splitout/).
* For a PDF downloaded by an [Http Request](/nodes/builtin/core/http-request/), use [Extract From File](/nodes/builtin/datatransformation/extractfromfile/) instead: it reads the downloaded file directly.

## Inputs and settings

**Input field** is a field name, not an expression. Use dots for nested fields, for example `file.content`. After [Local File Read](/nodes/builtin/datatransformation/localfileread/), set it to `content` and read the file as *Data URL* or *Base64*.

## Outputs

The output has two fields: the text under the **Output field name** (`text` by default) and `pageCount`. Turn on **Include input fields** to keep the incoming fields too, such as the file name from Local File Read. Use `{{ $input.text }}` in the next node.

## Dependencies and credentials

None. This node needs no connection and has no slots for other nodes.

## Example workflow

1. [Local File Read](/nodes/builtin/datatransformation/localfileread/) with **Read as** *Data URL* and **Accepted file types** `.pdf`.
2. **PDF Parser** with **Input field** `content`.
3. [Summarization](/nodes/builtin/ai/aiagents/summarizationchainnode/) with **Text** set to `{{ $input.text }}`, using a chat model such as [Chat OpenAI](/nodes/builtin/ai/aidependencies/llm/openai/).

## Common issues

* **"Field "data" does not exist in the input object ..."** No field has the name in **Input field**. Set it to the field that holds the PDF, for example `content`.
* **"Field "content" could not be decoded as base64 PDF data."** The field holds plain text, not a PDF encoding. Read the file as *Data URL* or *Base64*.
* **"... is a non-base64 data URL, which is not supported for PDF data."** The data URL is not base64. Produce a base64 data URL instead.
* **The text is empty or very short.** The PDF is a scan: its pages are images, not text. This node does not read text from images.

## Related nodes

* [Extract From File](/nodes/builtin/datatransformation/extractfromfile/): read PDFs, CSV, JSON and more from a downloaded file.
* [Local File Read](/nodes/builtin/datatransformation/localfileread/): pick a PDF from your computer.
* [Split Out](/nodes/builtin/datatransformation/splitout/): one item per page when pages are not merged.