Is it possible to check the content of a document without opening it?

Hello all!

I was wondering what activity can be used in order to check the content of a document without having it to be open? Is it possible?
Or is it mandatory to open a document in order to check its content?

Thank you in advance!

Depends on document

if it’s and excel, it can be done very easily
if its a pdf (text based, no images) then again

Hello Neonova and thank you for your quick reply.
Well it’s a pdf with images :confused:
I need to check if a box is well checked or not.

In that case you will need to use OCR Engine (read PDF with OCR activity in UiPath). It will open the pdf in background and scrap the image for data

1 Like

Yes! You’re right! I’ll try that one!! Thanks :slight_smile:

Most Welcome, and goodluck. In case it solves your issue , please fo mark an appropriate solution so others can benefit in future with the same issuei

1 Like

I’m trying to build the sequencet but I’m wondering how can I use OCR in a loop? Because it automatically opens the file with attach window.

@amarasto your take on this?

get all files in the folder in a List (using get directories )

then using for each loop use attach and ocr engine. Make sure the selector is attach window is generic (has wildcard in filename)

I’ve tried it but I keep having errors:
The selector seems not happy.

Please share your selector for attach activity here

Here it is:

tick the title check box above and instead of *.pdf -Adobe… just put a * and try

Another approach would be to use Image exists activity. Surround it in try catch. if it succeeds (that means checkbox picture is there, if it faisl that mean check box ticked image wa snot found)

you can use anchor base activity with it for more accuracy

For solution “For each”:

For solution “Try Catch”: will it use ‘Image exists’ activity without opening the pdf, because it is in the “Try Catch” activity?

You will still have to open the PDF using Open application activity (supply it with the pdf file path)

Once it is visible on screen you can use activate to bring it to front (if it is not)

Then just use image exists (try to tinker around to improve its accuracy)

Sorry for the delayed answer!
Do you have an example? I’m still struggling with it.
I’m not yet familiar with Try catch activity but it seems a great idea though!
I don’t need to bring it to front, actually if we can not open the pdf it would be great but it seems complicated to do so.
The ‘Image exists’ is not working properly :confused:
Main.xaml (12.9 KB)
I think it might be linked to the properties but I don’t know how to trick them.