PDF Get Text (Page)
PDF Get Text (Page)
Section titled “PDF Get Text (Page)”Type: pdf-get-text-page · Package: PDF Activities v1.2.4 · Output: string
Extracts the text of one specific page of a PDF. Useful when the value you need is always on a given page (the first, the last), or to process the document page by page.
How it works
Section titled “How it works”Returns the text of the page given in page (numbered from 1). It is the same text PDF Get Text gets for that page. It doesn’t modify the file.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
path | string | — | Path of the PDF file. |
page | int | — | Page number, starting at 1. Accepts a number or a text holding an integer ("3"). |
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”Returns a string with the text of that page. If the page has no text layer (scanned), an empty text.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'page' must be a positive integer. Received: …. | page is 0, negative, a decimal or not a number. |
Page … out of range. The document has … pages. | You asked for a page beyond the total. Get the total first with PDF Get Page Count. |
File not found. | The path doesn’t exist. |
'path' is required. / 'page' is required. | The parameter was left empty or its expression returned null. |
| PDF library error when opening the file | Password-protected or damaged PDF. See Protected and damaged PDFs. |
Example
Section titled “Example”Go through every page reading each one:
PDF Get Page Count path = filePath → output: totalFor Loop from = 1 to = total + 1 indexVariable = p └─ activities: PDF Get Text (Page) path = filePath page = p → output: pageText ... process the page ...Read only the last page (where totals usually are):
PDF Get Page Count path = filePath → output: totalPDF Get Text (Page) path = filePath page = total → output: lastPageRelated activities
Section titled “Related activities”- PDF Get Text — all the text at once.
- PDF Get Page Count — find out how many pages it has.