Get Page Number Action: getPageNumber
The getPageNumber action is used to identify the page number of the first occurrence of a specified text within a PDF file. This is particularly helpful for locating content in large documents.
Example: You have a PDF file named Report.pdf and want to find the page number of the first occurrence of the text “Quarterly Revenue”.
Steps to Configure:
- Add a new step.
- Select Set a Variable Value from the Action dropdown.
- Enter a variable name in Element Key (e.g., PageNumber). This variable will store the page number of the text’s first occurrence.
- Click on Form, select Functions, and choose PDF File Handler Functions.
- In the Cmd field, select getPageNumber and provide the following parameters:
- FPath: Specify the path of the PDF file to be scanned (e.g., C:\Reports\Report.pdf).
- Text: Enter the text to search for in the PDF file (e.g., Quarterly Revenue).
- Click Save.


Outcome on execution:
- The action returns the page number of the first occurrence of the specified text in the variable defined in the Element Key.
- If the text is not found, the variable remains empty or returns a specific error message.
- This variable can be referenced in subsequent steps of the automation process using the syntax ${VariableName} (e.g., ${PageNumber}).
Important Notes:
- The search is case-sensitive; verify the text input matches the text in the PDF.
- Only the first occurrence of the text is returned; subsequent occurrences are ignored.