Read PDF select text paragraph


I need to read the pdf paragraph, and as result i’m getting the line from the pdf file.!
The first image is what the uipath returns from reading all the pdf file.
The second one is what i need uipath return

Can you share the PDF file which you are trying to read ?


Hello @devKarthikeyanR,

Sure, here is the PDF File!alem_paraiba.PDF (270.2 KB)


strReadText.Substring(strReadText.IndexOf("00020 - "),strReadText.IndexOf("00021 - ")-strReadText.IndexOf("00020 - "))

Result is:


1 Like

Hello @devKarthikeyanR,

I need to split all the stretch from the pdf file. It is possible?
The following process will work in multiple pdf, the location of the text in pdfs is not the same.

Yes you can use the regex split.

1 Like

Can you show how use it? I was no able to.

We are matching this number

00020 - 0007964.79.2016.8.13.0015 we are matching numbers likes this.

You will get array of paragraph solutes, then as you want

1 Like

Hi, @devKarthikeyanR,

I’m getting some errors during the process - "Compiler error(s) encountered processing expression
{System.Tex.RegularExpressions.Match (texto, “\ d {5} \ s- \ s \ d {7}. \ D {2}. \ D {4 }. \ d {1}. \ d {2}. \ d {4}). value},
‘Match’ é um tipo em ‘RegularExpressions’ e não pode ser usado como uma expressão.

Thank you for the help!

I’m about to sleep and away from PC. I will give you the solution by tomorrow first thing.

1 Like


strReadText.Split({System.Text.RegularExpressions.Regex.Match(strReadText, “\d{5}\s-\s\d{7}.\d{2}.\d{4}.\d{1}.\d{2}.\d{4}”).Value},System.StringSplitOptions.RemoveEmptyEntries)

please use this.

1 Like


strReadText.Split({System.Text.RegularExpressions.Regex.Match(strReadText, “\d{5}\s-\s\d{7}\.\d{2}\.\d{4}\.\d{1}\.\d{2}\.\d{4}”).Value},System.StringSplitOptions.RemoveEmptyEntries)

1 Like

Hello friend,

Sorry to bother you again, i still reciving the wrong return.

What else can I post to facilitate the resolution?

What error you are getting now ? Can you show me.

1 Like

Did you have the soluction to post here?

I will post the solution tomorrow. I had tight schedule today.

1 Like

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