PDF doesn't open

Hello. I am doing an automation that opens a large volume of files (.zip, .xlsx, .docx, .pdf, etc.) I need to open all those files one by one and check if they open correctly. For that, I use the expression Directory.GetFiles (sourcePath, ".", SearchOption.AllDirectories)
So, what I need is to recognize when a file (for example pdf) does not open correctly for different reasons, but I don’t know how to do it, because when using the expression described above the files open in their respective applications (such as adobe acrobat or others) but they do not show the errors that the files may have.

@camilacalderon First of welcome in Community.
I got a chance to read your problem. I don’t know what activity you are using to open files.
But if you are not using “Start Process Activity”. Please try this one. It opens every file with their respectable tool.


Yes, I am using “Start Process Activity”. Thank you so much for your help, I was able to find a solution to solve the problem.

You should share your solution here so it can help others in the future.

Of course. I just use a PDF activity, in this case I’m using “Get PDF File Page Count” so if the PDF doesn’t open I throw an exception and catch the error. Because the main problem was that I didn’t know when a PDF was damaged or not.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.