Having issues with doing a loop and looking for image matches

I am trying to make a sequence that uses my company’s PDF software to find matches for specific text on each page of a document. I capture one item using a Take Screenshot activity, then loop through each page, using Image Exists/Find Image to look for something that matches the screenshot. The issue is, even if the screenshot was taken on another page, it only ever seems to find screenshots on the 1st page - after that, Image Exists will only return False, even if there is a matching part of the page, no matter how low I set the accuracy. This is all inside a While loop that (using UI automation) goes through each page of the document. Does anyone know why I might be encountering this issue? Do I need to “reset” something in the sequence?

Hi @brian_duddy

Welcome to our UiPath Forum! :slight_smile:

Could you clarify the process a bit, I struggle to get it fully.

This that would help:

  1. How does the source PDF file look like
    I understood this far that it is a multi-page document.
  2. What is the input you have and what is the expected output.
    A small example would be awesome :slight_smile:
  1. I have tried this with multiple documents. The core idea of this sequence is to recognize similar elements on each page of the document. I tried it with complex contracts, but I have the same results even with a document with one single letter on each page.

  2. The input is a PDF document, and the expected output is that our software places someone’s initials next to a specified element in each page. In order to do this, UiPath (using the Image Exists/Find Image activites) needs to properly detect that element multiple times, within a While loop. But that does not seem to be the case.

I use a Find Image on scanned images as a PDF with success, where the image can be on various pages. To get it accurate, I had to play with the Zoom along with Accuracy. Also, if it is running at unattended, the resolution must be set to the same settings as you developed it.

However, I would only use Find Image if the document is an image, whereas if the text is highlight-able, then maybe Get Text Position or Element automation might be better.

For me, I would run the document using Scroll keystrokes. And, this is not that simple either because when you zoom in, for example, a PageDown will place part of the page too low or too high. So, various tricks are needed to ensure you scan entire image of the PDF.

Clayton,

I am aware of most of these things. I make sure the zoom is the same, and I have tried accuracies all the way down to 0.1 with the same issue. I want this to work properly on image-based documents. And I already use our application’s Next Page and Fit Page function to ensure the entire page is displayed.