Table of Contents

Method GetPageInfo

Namespace
LMKit.Document.Pdf
Assembly
LM-Kit.NET.dll

GetPageInfo(string, int)

Returns size and orientation information for a specific page.

public static PdfPageInfo GetPageInfo(string inputPath, int pageIndex)

Parameters

inputPath string

Path to the PDF file.

pageIndex int

Zero-based page index.

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 inputPath is null.

FileNotFoundException

Thrown when inputPath does not exist.

ArgumentOutOfRangeException

Thrown when pageIndex is out of range.

GetPageInfo(Attachment, int)

Returns size and orientation information for a specific page.

public static PdfPageInfo GetPageInfo(Attachment source, int pageIndex)

Parameters

source Attachment

The source PDF attachment.

pageIndex int

Zero-based page index.

Returns

PdfPageInfo

A PdfPageInfo instance describing the page.

Exceptions

ArgumentNullException

Thrown when source is null.

ArgumentException

Thrown when the source attachment is not a PDF.

ArgumentOutOfRangeException

Thrown when pageIndex is out of range.

Share