How to extract data from secured pdf?

we have one pdf file that is secured with a password and we only need to get one value out of it but we could not achieve this with Read PDF activity or the OCR activity. we have also tried opening the pdf with WORD so that we use the Get Text but it could not recognize any anchor.

i know that REGEX might be helpful here but i know nothing about it or about how to do it and i would appreciate if anyone can help.

I cannot share the PDF but the value that we are after is inside a table with three columns and resides in the middle one bounded by service cost and Dollars

image

Hi @firas ,

If you are able to get whole text then you can use a string split option

str.Split(<before/after value>,Stringsplitoptions.None) . this gives you a array of strings

cheers

hello Anil
thank you for your reply.

please excuse me as i am no developer :sweat_smile:

did you mean that i need to use it as below?

str.Split(<Service Cost/Dollars>,Stringsplitoptions.None)

Hi @firas ,

say the string is stored in str (a variable)

then to get the 555 value between Service Cost and Dollars then use it as below
str.Split(“Service Cost”,2,Stringsplitoptions.None)(1).Split(“Dollars”,2,Stringsplitoptions.None)(0)

Hope this helps

cheers

Thank you @Anil_G for your kind reply; i will try it first thing when i go back to work tomorrow

1 Like

Hello again…I couldn’t wait till tomorrow and i tried to test it on one of the material from the course but i could not get it work; i am getting the below error; i have attached the workflow as well

TestPDFAgain.zip (307.8 KB)

Hi @firas ,

I would say I am surprised to see this. I saw you workflow nothing looks wrong. But when we use the same expression outside of your for loop then you are not getting any issue. Please try the same. Inside the for loop for some reason it is throwing an error but I still can execute the same command while bot is running

Attaching for you reference where inside loop it throw error but still the same expression is working on the panel
image

you can also use Text to left and right activity like below

image
image

cheers

you nailed it…thank you so much.Text to Left/Right was the answer

1 Like

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