Interface IPdfPage
PDF document page interface
Namespace: IronPdf.Pages
Assembly: IronPdf.dll
Syntax
public interface IPdfPage : IDocumentPage<IPdfPageObjectModel>, IPageContainer
IPdfPage is what you receive when you index a page out of PdfDocument.Pages, giving you the surface that any single PDF page exposes for text extraction, rotation, print sizing, and bounds editing. The concrete implementor in the IronPDF public API surface is PdfPage, which carries the runtime behavior plus a PdfClientAccessor base for engine communication.
Reach for IPdfPage when method signatures should accept or return a page without binding to the concrete PdfPage class. Typical scenarios include writing per-page processing helpers that iterate PdfDocument.Pages, building extension methods that read page text or rotation across mixed sources, and library code that consumes pages from any future implementor without recompilation. Reading the indexer value directly returns IPdfPage, so a cast to PdfPage is required for the three mutation methods only when the additional concrete surface is needed.
The members declared directly on IPdfPage group into content extraction (Text, Characters, Lines, TextChunks), orientation (PageRotation typed as IronPdf.Rendering.PdfPageRotation), print sizing (PrintWidth, PrintHeight), and three mutation methods (Resize, Extend, Transform) that take an IronPdf.Editing.MeasurementUnit. The base interfaces add the everyday members callers rely on: ObjectModel (from IDocumentPage<IPdfPageObjectModel>) returns the PDFium-backed DOM, while Width, Height, and PageIndex reach the interface through IPageContainer and the generic IDocumentPage contract. The three mutation methods are the only members that commonly require the concrete PdfPage, since PageRotation is settable on the interface itself.
using IronPdf;
using IronPdf.Pages;
using IronPdf.Rendering;
using IronPdf.Editing;
PdfDocument pdf = PdfDocument.FromFile("report.pdf");
PdfPagesCollection pages = pdf.Pages;
// The indexer returns IPdfPage. Read interface members without a cast.
IPdfPage page = pages[0];
string pageText = page.Text;
PdfPageRotation rotation = page.PageRotation;
double widthMm = page.Width;
// Cast to PdfPage only when the concrete mutation surface is needed.
if (page is PdfPage concrete)
{
concrete.Resize(210, 297, MeasurementUnit.Millimeter);
concrete.PageRotation = PdfPageRotation.Clockwise90;
}
pdf.SaveAs("report-rotated.pdf");For per-page editing work, the transform PDF pages how-to covers the translate-and-scale idiom against indexed pages. To read or rewrite the page DOM through ObjectModel, see the PDF DOM object guide. For broader page management at the collection level, the add, copy, and delete pages how-to shows the surrounding Merge, InsertPdf, and RemovePage workflow.
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) |