Class PageInfo
Represents metadata information for a single page within a PDF document displayed in the SfPdfViewer2 component.
Inherited Members
Namespace: Syncfusion.Blazor.SfPdfViewer
Assembly: Syncfusion.Blazor.SfPdfViewer.dll
Syntax
public class PageInfo
Remarks
The PageInfo class provides essential details about a PDF page, including its dimensions, rotation angle, and page number. This class is useful for inspecting page properties and performing operations such as rotation, reordering, or layout analysis.
Examples
Below is an example demonstrating how to access properties of the PageInfo class:
PageInfo pageInfo = viewer.GetPageDetails(0);
int pageNumber = pageInfo.PageNumber;
int width = pageInfo.Width;
int height = pageInfo.Height;
PageRotation rotation = pageInfo.RotationAngle;
Constructors
PageInfo()
Declaration
public PageInfo()
Properties
Height
Gets the height of the page in points.
Declaration
public double Height { get; }
Property Value
| Type | Description |
|---|---|
| double | A |
Remarks
The Height property provides the vertical dimension of the page. This value is useful for layout calculations and rendering logic.
Examples
void OnPageSelected(PageSelectEventArgs args)
{
foreach (PageInfo page in args.SelectedPages)
{
Console.WriteLine($"Page Height: {page.Height}");
}
}
PageNumber
Gets the 1-based index of the page within the PDF document.
Declaration
public int PageNumber { get; }
Property Value
| Type | Description |
|---|---|
| int | An |
Remarks
The PageNumber property identifies the page's position in the document. This is useful for referencing specific pages during operations like rotation or deletion.
Examples
void OnPageSelected(PageSelectEventArgs args)
{
foreach (PageInfo page in args.SelectedPages)
{
Console.WriteLine($"Page Index: {page.PageNumber}");
}
}
RotationAngle
Gets the rotation angle applied to the page.
Declaration
public PageRotation RotationAngle { get; }
Property Value
| Type | Description |
|---|---|
| PageRotation | A PageRotation value representing the rotation angle of the page. |
Remarks
The RotationAngle property indicates the current rotation of the page using the PageRotation enumeration. This is useful for determining the orientation of the page and applying rotation-based logic.
Examples
void OnPageSelected(PageSelectEventArgs args)
{
foreach (PageInfo page in args.SelectedPages)
{
Console.WriteLine($"Rotation Angle: {page.RotationAngle}");
}
}
Width
Gets the width of the page in points.
Declaration
public double Width { get; }
Property Value
| Type | Description |
|---|---|
| double | A |
Remarks
The Width property provides the horizontal dimension of the page. This value is useful for layout calculations and rendering logic.
Examples
void OnPageSelected(PageSelectEventArgs args)
{
foreach (PageInfo page in args.SelectedPages)
{
Console.WriteLine($"Page Width: {page.Width}");
}
}