Extract text
Extract the text of a PDF, of a page range or of chosen pages, as plain or layout-ordered text, optionally into a .txt file. Scanned PDFs (images) need OCR instead.
Command in the PDF toolkit · id ooa.pdf/extract_text · 8 inputs (1 required), 2 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Path | File | Yes | PDF file. | |
| From page | Number | No | 1 | First page (1-based). |
| To page | Number | No | Last page; the end when empty. | |
| Password | Credential | No | Password for protected PDFs. | |
| Mode | String | No | structured | structured orders text by its position on the page, keeping columns and tables readable; plain keeps the order stored in the file, like copy and paste. |
| Pages | String | No | Exact pages to read, e.g. 1,3,5-7, in that order; overrides from_page and to_page. | |
| Output file | File | No | Also write the text to this .txt file (UTF-8). | |
| Overwrite | Boolean | No | true | Replace output_file when it already exists; false stops with PDF.EXISTS. |
Outputs
| Output | Type | What it is |
|---|---|---|
| text | String | Extracted text. |
| page_count | Number | Total pages in the document. |