Method GetNumberOfPages GetNumberOfPages() Counts the number of pages in the current document. Declaration int GetNumberOfPages() Returns Type Description System.Int32 -1 in case of error.