Get Text : How to indicate particular element from pdf file?

Hi Everyone,

I’m using Get Text Activity to fetch the due amount from the invoice pdf. But indicator is selecting the whole pdf file.

Please tell me what settings I must do .

Thanks in Advance:-)

Hi @Vaishnav_Tej

You can use Read Pdf activity and get the data via regex

Regards
Gokul

Hi @Vaishnav_Tej

As @Gokul001 suggestion you can use PDF packages and regex, and it is better to work with regex or document understanding to get the values from pdf than the using selectors

Can you share the sample pdf file here?

Regards
Sudharsan

Have you look for this @Vaishnav_Tej

Check out the XAML file and thread

ExtractDatafromPDFRegex.xaml (10.7 KB)

Regards
Gokul

wordpress.pdf (42.6 KB)

I have no idea on regex and document understanding . Can you send any youtube links?

@Vaishnav_Tej
Checkout this

Regards
Sudharsan

This workflow will do the same check out @Vaishnav_Tej

1 Like

Hi @Vaishnav_Tej

You can try with Regex expression

System.Text.RegularExpressions.Regex.Match(YourString,"(?<=Total\sDue\s).*").Tostring

Regards
Gokul

Check this update Workflow based on your PDF @Vaishnav_Tej

ExtractDatafromPDFRegex.xaml (11.0 KB)

Output

image

Regards
Gokul

@Vaishnav_Tej

Try this too

System.Text.RegularExpressions.Regex.Match(str,"(?<=Total\sDue).*").ToString.Trim

image

Sample xaml file
Sample.xaml (7.0 KB)

Regards
Sudharsan

Alternative method @Vaishnav_Tej

Split Method

Split(Split(Str,"Total Due")(1).Trim,vbNewLine)(0)

image

Sample xaml
Sample.xaml (6.6 KB)

Regards
Sudharsan

Hi,

I’m getting error.

Get Text.xaml: Compiler error(s) encountered processing expression “Split(Split(Str,“Total Due”)(1).Trim,vbNewLine)(0)”.
Argument not specified for parameter ‘Number’ of ‘Public Function Str(Number As Object) As String’.

Have you tried with this workflow @Vaishnav_Tej

Can you share the sceenshot of your workflow ? @Vaishnav_Tej

Some Activities from the workflow you shared are not opening

Share the screenshot @Vaishnav_Tej

Go to → Manage package → Uipath.PDF.Activitie