Class PdfPage
A class which represents one page of a PDF Document.
Implements
Namespace: IronPdf.Pages
Assembly: IronPdf.dll
Syntax
public class PdfPage : PdfClientAccessor, IPdfPage, IDocumentPage<IPdfPageObjectModel>, IDocumentPageWithDimensions
Constructors
PdfPage(Double, Double)
Create a new PDF page, not yet attached to a document
Declaration
public PdfPage(double Width, double Height)
Parameters
Type | Name | Description |
---|---|---|
System.Double | Width | Page width (mm) |
System.Double | Height | Page height (mm) |
Properties
Characters
A collection of all characters on this page and their position
Also see TextChunks and Lines
Declaration
public IDocumentCharCollection Characters { get; }
Property Value
Type | Description |
---|---|
IronSoftware.IDocumentCharCollection |
Height
Gets the height of the pdf page in mm.
Declaration
public double Height { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Lines
A collection of all lines of text on this page and their position
Declaration
public IPdfTextObjectCollection Lines { get; }
Property Value
Type | Description |
---|---|
IPdfTextObjectCollection |
Remarks
Derived from TextChunks for your convenience
ObjectModel
Declaration
public IPdfPageObjectModel ObjectModel { get; }
Property Value
Type | Description |
---|---|
IPdfPageObjectModel |
PageIndex
Gets the page index
Declaration
public int PageIndex { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
PageRotation
Gets the page orientation.
Declaration
public PdfPageRotation PageRotation { get; set; }
Property Value
Type | Description |
---|---|
PdfPageRotation |
PrintHeight
Gets the height of the pdf page in printer points.
Declaration
public double PrintHeight { get; }
Property Value
Type | Description |
---|---|
System.Double |
PrintWidth
Gets the width of the pdf page in printer points.
Declaration
public double PrintWidth { get; }
Property Value
Type | Description |
---|---|
System.Double |
Text
Page text
Declaration
public 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
public IPdfTextObjectCollection TextChunks { get; }
Property Value
Type | Description |
---|---|
IPdfTextObjectCollection |
Width
Gets the width of the pdf page in mm.
Declaration
public double Width { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
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
public 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
public 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
public 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) |