Method GetPageCount
GetPageCount(string)
Returns the number of pages in a PDF file.
public static int GetPageCount(string inputPath)
Parameters
inputPathstringPath to the PDF file.
Returns
- int
The total number of pages.
Exceptions
- ArgumentNullException
Thrown when
inputPathisnull.- FileNotFoundException
Thrown when
inputPathdoes not exist.
GetPageCount(Attachment)
Returns the number of pages in a PDF attachment.
public static int GetPageCount(Attachment source)
Parameters
sourceAttachmentThe source PDF attachment.
Returns
- int
The total number of pages.
Exceptions
- ArgumentNullException
Thrown when
sourceisnull.- ArgumentException
Thrown when the source attachment is not a PDF.