Challenge 13


#1

There is a challenge which I’m currently looking at

The idea is that you open a pdf document and then go through several lines in the document working out which of 3 check boxes have been ticked in each row.

To give an indication of row position I look for a text string found in each row.

I use that as a starting point to generate a region (this is where it is going wrong I think) that I want to search for the tick box (My method the region doesn’t seem to be changing so I always pick the same tick box, when that bit is working). I assign a region to check (the size of the box should be the same each time it’s only the Y position that should change)

CheckBoxesRegion = New UiPath.Core.Region(New Rectangle(103, Y, 309, 38))

The problem is that I then want to Find Image but only look in that CheckBoxesRegion.

The result from the find image does not change, it doesn’t loop through all the rows. I’ve stepped through the code but can’t see why it quits the loop

If anyone can see what I’m doing wrong here it would be appreciated.

My code is here

Chall13_PDFScraping.zip (415.5 KB)

Many thanks,


13.RPA Challenge - PDF Scrapping
#2

I have a feeling that what is happening is that when the PDF is opened it opens up BIG and only 2 lines of the data that I am interested in are showing. I think this may be causing some of my problems in that maybe only the shown region is capable of being searched. Anyway will look into it.


#3

OK that didn’t help, but I’ll keep the click ‘Fit on one page’ button in the code so I can see the whole pdf while the code is running.

Chall13_PDFScraping.zip (415.9 KB)


#4

What I’d like to do is use the Highlight activity to show the region that I’m searching for the tick box (when debugging) but I think that the highlight activity just accepts an element and I have a region (It has a clipping region property but I’m not sure how that works as if I put values in the left top right and bottom text boxes they disappear when I go back to the activity)


#5

Just updating this in the hope that someone will look at it and offer a suggestion.

The first thing I want to do is in a screen shot image of a front end system (to mimic citrix) is to find all the occurences of a particular image (using Find image matches) then using the position of each of the images offset their location and resize it to search for another image, relative to the first (I only want to search for the second image in this offsetted region).

Can this be done?