nodes / builtin / datatransformation
PDF Parser
Extract text from a PDF
Extract the text from a PDF, as one string or one string per page.
What it does
Section titled “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
Section titled “When to use it”- Summarise or question a PDF with an AI node, using its text.
- Search a PDF’s text with Regex, for example to find an invoice number.
- Handle each page separately: turn Merge pages off, then use Split Out.
- For a PDF downloaded by an Http Request, use Extract From File instead: it reads the downloaded file directly.
Inputs and settings
Section titled “Inputs and settings”| Setting | Type | What it does |
|---|---|---|
| Input field | Text | The path to the field holding the PDF data (base64 string, data URL, ArrayBuffer/Uint8Array, or array of bytes). Default: data |
| Output field name | Text | The name of the output field that will hold the extracted text. Default: text |
| Merge pages | Toggle | When enabled, output one merged string for the whole document. When disabled, output an array with one string per page. Default: On |
| Options | Group | The options for the node. |
| Options › Include input fields | Toggle | Whether to include the original input fields in the output. Default: Off |
Input field is a field name, not an expression. Use dots for nested fields, for example file.content. After Local File Read, set it to content and read the file as Data URL or Base64.
Outputs
Section titled “Outputs”-
Output
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
Section titled “Dependencies and credentials”None. This node needs no connection and has no slots for other nodes.
Example workflow
Section titled “Example workflow”- Local File Read with Read as Data URL and Accepted file types
.pdf. - PDF Parser with Input field
content. - Summarization with Text set to
{{ $input.text }}, using a chat model such as Chat OpenAI.
Common issues
Section titled “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
Section titled “Related nodes”- Extract From File: read PDFs, CSV, JSON and more from a downloaded file.
- Local File Read: pick a PDF from your computer.
- Split Out: one item per page when pages are not merged.