How to find the total number of pages in a pdf file in uipath

Hi all,

How to find the total number of pages in a pdf file in uipath

Thanks in adavnce

1 Like

@maria.josephina Check attached zip file

PdfPageCount.zip (422.1 KB)

7 Likes

Hi @indra,

Thankyou for replying. This actually works. But I have a few queries.

What does this regular expression means ?
Regex.Matches(StrReader.ReadToEnd(),"/Type\s*/Page[^s]")

WHat is the output of StrReader.ReadToEnd() ?

@maria.josephina Regex.Matches(StrReader.ReadToEnd(),"/Type\s*/Page[^s]") this is used to match the page number in pdf

https://www.dotnetperls.com/streamreader-readtoend

@indra One more doubt like ;
Where in the pdf pages we can see a string like /Type\s*/Page[^s] ?

@maria.josephina https://stackoverflow.com/questions/1878939/c-sharp-regular-expression

Thanks @indra.
But I understood that. My question is that : In the pdf file, where do we see this type of string /Type/Page

My question is that : In the pdf file, where do we see this type of string /Type/Page

have you check this.?

Hi maria.josephina !

there is a function called “Get Pages” in uipath 10.0 . You need to put the filepath and the output is a integer with the number of pages

Att.

1 Like

great solution, well done