You have to provide anchors and ensure the correct page boundaries are identified - not just the keywords.
Here's the idea:
- Read pdf page by page with activity Read PDF Text
- Search the text string with activity IsMatch
- If a match (Boolean) is found, add a data row containing the search text and starting page number
- increment page number
- repeat step 2
- If the second page is read, update the previous data row ending page number
- When the last page is read, update the data row ending page number
- Finally, Extract PDF Page Range to extract the pages.
You could use Assign Regex Pattern activity to replace a space with \s for a regular expression to work correctly. You will need to change it accordingly for the text you are searching