Contains Action: Contains
The PDFHandle Contains function checks for the presence of specific text, words, or sentences within a PDF file. This is useful for verifying if a particular string exists in a given range of pages in the PDF document.
Example: You need to verify if the phrase “Auto-Certification Platform” exists on page 2 of the DeviceReport.pdf file located in C:\User\Documents\.
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., PDFContainsResult). This variable will store the result of the operation (true or false).
- Click on Form, select Functions, and choose PDF File Handler Functions.
- In the Action dropdown, select Contains.
- Provide Parameters:
- FPath: Specify the full path of the PDF file to be checked (e.g., C:\User\Documents\DeviceReport.pdf).
- Text: Enter the exact text or phrase to search for (e.g., Auto-Certification Platform).
- Start: Define the starting page number for the search (e.g., 2).
- End: Define the ending page number for the search (e.g., 2).
- Click Save.


Outcome on execution:
- True: If the phrase exists within the specified page range.
- False: If the phrase is not found.
- The result (true or false) is stored in the variable defined in Element Key. This variable can be used in later steps of your automation process to reference the stored information using the syntax ${VariableName} (e.g., ${PDFContainsResult}).
Note: The search is case-sensitive. Enter the text exactly as it appears in the PDF.