Interface IPdfPage
PDF document page interface
Namespace: IronPdf.Pages
Assembly: IronPdf.dll
Syntax
public interface IPdfPage
Working with PDF pages through a shared contract runs through IPdfPage. It represents PDF document page interface, so code can work with PDF pages uniformly across implementors rather than binding to a concrete type.
Concrete implementors include PdfPage, IronPDF concrete implementor. Code that accepts IPdfPage works uniformly across these implementors, so applications can read or configure C# PDF features without binding to a specific concrete type.
Most of the usable surface is inherited. The members that carry everyday use of this contract are Characters, Lines, PageRotation, PrintHeight; consult these first when implementing or consuming IPdfPage.
using IronPdf;
// IPdfPage is consumed as the API surface for the family of implementors
void Consume(IPdfPage target)
{
// Use members defined on the interface; concrete behavior follows the implementor
}For collection-wide operations and end-to-end examples, see the IronPDF C# documentation for related guides. For collection-wide operations on IPdfPage instances, the IronPDF C# documentation lists the relevant container types and their methods. Concrete behavior depends on which implementor of IPdfPage is returned at runtime; consult the specific class reference for type-specific members. Polymorphic access through IPdfPage lets code work uniformly across the family of implementors, with a cast required only when type-specific behavior is needed. The reference tables below list the full set of members defined on IPdfPage along with any inherited members exposed through the contract. In a typical IronPDF C# workflow, IPdfPage appears as a parameter or return type at the boundary between the application and the IronPDF API. See the methods table below for the complete set of members defined directly on IPdfPage. Implementing IPdfPage directly in application code is uncommon; the typical pattern is to consume instances returned from the IronPDF API. When iterating over a collection of IPdfPage instances, prefer the inherited members for portable code; downcast only when type-specific behavior is required.
Properties
Characters
A collection of all characters on this page and their position
Also see TextChunks and Lines
Declaration
IDocumentCharCollection Characters { get; }
Property Value
| Type | Description |
|---|---|
| IronSoftware.Abstractions.Pdf.IDocumentCharCollection |
Lines
A collection of all lines of text on this page and their position
Declaration
IPdfTextObjectCollection Lines { get; }
Property Value
| Type | Description |
|---|---|
| IPdfTextObjectCollection |
Remarks
Derived from TextChunks for your convenience
PageRotation
Gets the page orientation.
Declaration
PdfPageRotation PageRotation { get; }
Property Value
| Type | Description |
|---|---|
| PdfPageRotation |
PrintHeight
Gets the height of the pdf page in printer points.
Declaration
double PrintHeight { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
PrintWidth
Gets the width of the pdf page in printer points.
Declaration
double PrintWidth { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Text
Page text
Declaration
string Text { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
TextChunks
A collection of all text objects on this page and their position
The contents of each text object is rendered as a single unit
The contents of each text object share font, origin position, etc.
Also see Characters and Lines
Declaration
IPdfTextObjectCollection TextChunks { get; }
Property Value
| Type | Description |
|---|---|
| IPdfTextObjectCollection |
Methods
Extend(Double, Double, Double, Double, MeasurementUnit)
Extends this page bounds using the specified parameters (in millimeters)
Does not resize page content; results in an empty margin around existing page content
Declaration
void Extend(double ExtendLeft, double ExtendRight, double ExtendTop, double ExtendBottom, MeasurementUnit Units)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | ExtendLeft | Desired amount (mm) to extend page width towards the left |
| System.Double | ExtendRight | Desired amount (mm) to extend page width towards the right |
| System.Double | ExtendTop | Desired amount (mm) to extend page height towards the top |
| System.Double | ExtendBottom | Desired amount (mm) to extend page height towards the bottom |
| MeasurementUnit | Units | Optionally specify units of measurement for input parameters |
Resize(Double, Double, MeasurementUnit)
Resize this page to the specified dimensions (in millimeters)
Declaration
void Resize(double PageWidth, double PageHeight, MeasurementUnit Units)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | PageWidth | Desired page width, in millimeters |
| System.Double | PageHeight | Desired page height, in millimeters |
| MeasurementUnit | Units | Optionally specify units of measurement for input parameters |
Transform(Double, Double, Double, Double)
Transforms this page contents using the specified parameters
Affects the appearance of all content displayed on the page. Does NOT affect the physical page dimensions.
Declaration
void Transform(double MoveX, double MoveY, double ScaleX, double ScaleY)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | MoveX | Move the page contents left (negative) or right (positive), in millimeters |
| System.Double | MoveY | Move the page contents down (negative) or up (positive), in millimeters |
| System.Double | ScaleX | Scale the page contents horizontally (0.0 to infinity, where 1.0 is default scaling) |
| System.Double | ScaleY | Scale the page contents vertically (0.0 to infinity, where 1.0 is default scaling) |