Trouble by analyzing a pdf

Hey Community,

I planed a sequence which works throw all PDF Files in a folder.
Therefore, Uipath should control each file if its fulfill specific conditions.
These would be:

If the following words are each more than 40 times present in the document:
{„company“, „invoice“, „customer“ , „machine“ }

And the second condition would be that the total pages of the document must be more than 50.

In a new Excel File, Uipath should write down the names of the files and in a new column if the file accomplish these conditions with a „Yes“ or „No“.

Thank you for any help.

Hi @Okan ,

You can achieve this check by using some basic UiPath activities like:

A sketch of a such workflow could be:

Demo file: CheckPDFs.xaml (40.6 KB)

Please make sure that the UiPath.PDF.Activities package is installed.

Hope this helps!
Best regards,
Marius

thank you very much.
I will try it out

I build the workflow like you did. To check and understand every section.

Unfortunately I get an error on the second “For Each” activity inside the Flowchart, where he cant find a part of the path (where my PDF files are stored).

Hi @Okan ,

Can you please share a print screen of the error? or of your workflow?

It seems that you would have to use an absolute file path within your project. Refer to this.

The helper .xaml file has relative paths, and it works as long as the .pdf file are within the project.

Best regards,
Marius

hi @Marius_Puscasu,

here is a screenshot of the error:

It translate as: “For Each: a part of the path:“C:\Users\NAME.…” could not be found”

Inside the folder are only multiple PDF-Files stored.

Hi @Okan ,

Within a read pdf activity you have to provide the pdf file, not the pdf folder where the files are found. That’s why you have the error.

Please make sure that your workflow has the pdf variable within the For Each Loop, and to the sourceDir variable

Best regards,
Marius

Hi @Marius_Puscasu,

thank you for your help.
But I still dont get it.

I have set the pdf variable on the For Each Loop with the Directory.GetFiles(SourceDir) but i still get an error.