Exception on New StreamReader activity

Out of the blue I’m started experiencing an error inside an assign activity which assign the value of a New StreamReader(filePathStringVariable) to a Streamreader variable. The error message:

Main has thrown an exception
Message: Job RoboView stopped due to unexpected process termination!
Exception Type: Exception
System.Exception: Job RoboView stopped due to unexpected process termination!

The log file 2020-10-12_Execution.json (777.5 KB)

Right now it occurs all the time I run the robot (both from Studio and also from Orchestrator). I’ve also tested numerous pdf files (different page numbers, different content) but I’m not able to wrap my head around it.

There weren’t any relevant operations done on the server in the meanwhile (checked with my company internal IT department).

StreamReader is a TextReader, it reads .txt file, so it is dubious to me it should read from a pdf file. Can you try Read Pdf Text activity and Read Pdf with Ocr (you need to install UiPath.Pdf.Activities packages)

I choosed StreamReader because I need to count and loop through the pages of the pdf file. Here below a screenshot of the next activities in the workflow:

Do you know an easier way to count them?
Btw, that activity always worked. I was always able to know how many pages where in it and loop through them.

Get PDF Page Count

As a matter of fact, UiPath.Pdf.Activities package has a lot of activities that allows you to read, merge, split, extract and so on, so you might want to check it out

Tried that but I’m forced to use Studio 2018.2.3 which doesn’t support the package Pdf Activities

Wow, 2018 is really old. Why not update to the latest? There has been some major updates.

But in any case, IText has been widely used in handling pdfs in .net.