How do I find page number in PDF?

Q: We have a question about getting the proper pagenumber with the
PDFNET SDK component, we bought 2 weeks ago.

We need to get the pagenumber, not the index. How do we do that? Let’s
say we have a PDF with one page, but it’s pagenumber is 22. The
GetIndex() method gives us one, but we need the 22.
---------------------
A: In case you are looking for a page label, you could use PDFTron's
page label API (as shown in PageLabels sample -
http://www.pdftron.com/pdfnet/samplecode.html#PageLabels).

In case you are referring to a page number that only exist within the
page content stream, the only way to get it is using
'pdftron.PDF.TextExtractor' (see TextExtract sample project -
http://www.pdftron.com/pdfnet/samplecode.html#TextExtract). In this
case you could search for text within a given region (say lower right
corner - specified as an optional Rect paramateter in
TextExtractor.Begin()) and extract the text that represent a page
number. Please keep in mind that unless you are sure where the page
number is located this is an error prone process.