Method GetPageInfo
GetPageInfo(string, int)
Returns size and orientation information for a specific page.
public static PdfPageInfo GetPageInfo(string inputPath, int pageIndex)
Parameters
Returns
- PdfPageInfo
A PdfPageInfo instance describing the page.
Examples
using LMKit.Document.Pdf;
var page = PdfInfo.GetPageInfo("report.pdf", 0);
Console.WriteLine($"Page 1: {page.Width}x{page.Height} pt, orientation: {page.Orientation}");
Exceptions
- ArgumentNullException
Thrown when
inputPathisnull.- FileNotFoundException
Thrown when
inputPathdoes not exist.- ArgumentOutOfRangeException
Thrown when
pageIndexis out of range.
GetPageInfo(Attachment, int)
Returns size and orientation information for a specific page.
public static PdfPageInfo GetPageInfo(Attachment source, int pageIndex)
Parameters
sourceAttachmentThe source PDF attachment.
pageIndexintZero-based page index.
Returns
- PdfPageInfo
A PdfPageInfo instance describing the page.
Exceptions
- ArgumentNullException
Thrown when
sourceisnull.- ArgumentException
Thrown when the source attachment is not a PDF.
- ArgumentOutOfRangeException
Thrown when
pageIndexis out of range.