Open a scanned PDF file in the correct orientation

I am creating a workflow that opens an eFax PDF form. The BOT makes sure the PDF form is starting on the first page. The BOT then uses Image Exist and Get OCR text to confirm the form is on the correct page before scrapping the values I need.

FYI: I used Image exist and Get OCR text in case one activity fails, the other will find the key words (Certification or Work Release) I am matching against using regular expression.

I noticed that sometimes the Image exist does not return a TRUE Boolean when expected. It appears if the image I am checking is not the same boldness or is a little darker than the image in my code, the Image exists returns fail although the BOT is on the correct page.

I decided to incorporate a Get OCR text into the code so that if the Image Exists fails, the Get OCR text will know the BOT is on the right page because it is only looking for my key word on the page. Once the key word is located, it sends it to the other activity to scrape the value from the specific area of the page. This approach works until the orientation is side ways or upside down. If the PDF page is in one of those directions, the value scrapped is not the same as the value when the PDF page is in the correct orientation.

Is there a hotkey or way to make sure the PDF file always open in the correct orientation?

I am using Google Vision OCR and as long as the PDF files opens up in the correct orientation. But sometime, a few may come over in the incorrect orientation and the BOT can’t find the value.

Any suggestions would be appreciated.

Dear Kevin,
Is it possible for you to incorporate Document Understanding for your requirement?
As Document Understanding has good extraction capabilities for titled images as compared to normal PDF activities.

Thanks,
Geetishree Rao

I tried using Document Understanding at first, but since these are images of PDF files (emailed eFaxes that come over as an PDF file ), not the typical PDF files I can select fields from, I had issues.

Maybe I was not using DU correctly. :blush:

Thanks

image001.jpg

Hi

Welcome back to UiPath forum

I think document understanding will help us here as @geetishree.rao mentioned

Have a look on this for more idea

Cheers @kelvin_lester

Dear Kelvin,

Please refer the below document understanding link by Lahiru Fernando (MVP) which matches your case.
He has an impressive Doc Understanding playlist explaining all the conepts of UiPath Document Understanding

Document Template Creation with Anchors in UiPath | RPA | Automation | Document Understanding - YouTube

Thanks,
Geetishree Rao

Okay, thanks!

image001.jpg

I’ve used this C# code and it works very well.

https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Page-Setting/How-to-rotate-the-PDF-file-in-C.html

Here’s a thread with all the doubts cleared for this part

1 Like

Awesome, I will check it out!

image001.jpg

Rahul,

Just to make sure we are on the same page, the rotation is corrected if the page is turned sideways to the left or right as well as if the top of the page is turned towards the bottom?

I am use to JavaScript, so I am reviewing the code in an effort to better understand it so that I can explain it to my team. :blush:

Thanks,

image001.jpg