PDF Extractor
PDF Extractor reads one or more PDF files and returns their content ready to use: the text in order, with its headings and tables. It works with PDFs that contain text, such as those produced by a word processor or an invoicing program, and it does not need an AI model.
Use it as the first step when a flow receives PDF documents and an agent or component has to read them.
When to use it
- Read the PDF invoices that arrive by email to get their amounts.
- Prepare contracts or manuals to store them in a knowledge base.
- Give an agent the content of a report so it can summarise it.
- Extract the tables from a price catalogue.
Configuration
| Field | What it does |
|---|---|
| Documents | The PDF files you want to read. You can connect one or more. |
| Extract Text | Gets the text of each page. On by default. |
| Extract Tables | Gets the document’s tables. On by default. |
| Extract Images | Gets the images contained in the document. On by default. |
| Minimum Image Size (pixels) | Minimum size, in pixels of width or height, for an image to be included. It keeps small icons and logos out. Default: 250. |
Advanced options
| Field | What it does |
|---|---|
| Detect Columns | Detects documents laid out in several columns and puts the text in the right reading order. On by default. |
| Caption Proximity (pixels) | Maximum distance, in pixels, at which a piece of text counts as an image’s caption or title. Default: 50. |
| Silent Errors | If a file cannot be read, carries on with the others and leaves a note with the error in the result, instead of stopping the flow. Off by default. |
Output
The Data output usually returns one result per PDF with:
text: all the document’s text, with its headings and tables as text.source_file: the file name.
If a document cannot be read in one go, the component reads it page by page and returns one result per page, with its number (page_number), its text and, depending on the Extract Text, Extract Tables and Extract Images switches, the tables and images it finds, with their caption if they have one.
If a file that arrives is not a PDF, the component fails with an error, unless you turn on Silent Errors.
Example
The purchasing department receives supplier quotes as PDFs and wants to compare them.
- Connect the PDF quotes to Documents.
- Connect the Data output to an agent instructed to get each quote’s supplier, total amount and delivery time.
- Send the agent’s comparison to the purchasing team.
Good practices
- If your PDFs are scanned documents, that is, pictures of paper, they contain no text to read: use a component that reads text from images, such as Easy OCR.
- To process many files at once, turn on Silent Errors and review the results with errors afterwards.
Related components
- PDF Page Index: to get the table of contents of a long PDF, with its chapters and sections.
- Easy OCR: to read the text in an image.