Variable selector - pdf files

Hi,

I am trying to find out how to get specific data from pdf files. There are more of them so I need to create a dynamic selector to extract the data from each pdf file. However, the Anchor base and Find element does not work. I can edit selector:

<wnd app=‘acrord32.exe’ cls=‘AcrobatSDIWindow’ title=’*.pdf - Adobe Acrobat Reader DC’ />



I am afraid that also the indication needs to be modified? * does not work though

Can someone advice?

Thank you very much

Tereza

Hi @Tereza_Steflova

Give a try with PDF activity in Uipath to extract data from PDF. This would be more relaible and better than UI Automation as they are less chance of selector failure there

Hi @Tereza_Steflova

You can use the regular expression also using the isMatch activity or Match activity for extracting the specific data from the pdf file without using the UI Automation.

Hi @Tereza_Steflova

If you are using Adobe Reader DC 19.012.20040 or greater. you can use the below activity

Identifying UI Elements in PDF With Accessibility Options

I am trying to use Regex, however I still did not find the right formula, the text looks like this:

I tried to use:

System.Text.RegularExpressions.Regex.Match(pdfExtract,"((?<=Sub Total )\d+[.]\d+)|((?<=GST \d\d% )\d+[.]\d+|(?<=GST \d% )\d+[.]\d+)|((?<=Total )\d+[.]\d+)").ToString

But it gives me an empty value.

Do you have some advice?

Thank you!

Use this expression

(?<=Sub Total\s).* (for Sub Total GST and Total)

Just change the Text name.

Try this and let me know

I used

System.Text.RegularExpressions.Regex.Match(pdfExtract,"(?<=Sub Total\s).* (for Sub Total GST and Total)").ToString

and it is not working

Try to fetch the data using the Read PDF with OCR activity.

or if it is possible then send me the PDF file.

I did this, problem is to extract the data using regex