Skip to main content

Page

Version: 6.0

cete.dynamicpdf.page

Page​

Represents a page.

public class Page
Public Class Page

Inheritance: Object → Page

Derived: AppendedPage, ImportedPage

Licensing​

This class is a DynamicPDF Generator Community Edition feature.

Examples​

The following example creates a new page using a PageDimensions to set the margins of that page.
It then places a label on the page and rotates the page 90 degrees.

Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements

Module MyModule Sub Main() ' Create a PDF Document Dim MyDocument As Document = New Document ' Create a page dimensions object and set the margins Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait) dimensions.BottomMargin = 50 dimensions.TopMargin = 50 dimensions.LeftMargin = 35 dimensions.RightMargin = 35 ' Create a page using a page dimensions object and add it to the document Dim MyPage As Page = New Page(dimensions) MyDocument.Pages.Add(MyPage)
' Add a label to the page MyPage.Elements.Add(New Label("this page was rotated 90 degrees.", 0, 0, 300, 20, Font.Helvetica, 18))
' Rotate the page 90 degrees MyPage.Rotate = 90
' Save the PDF MyDocument.Draw("C:\MyDocument.pdf") End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

class MyClass
{static void Main(){ // Create a PDF Document Document document = new Document();
// Create a page dimensions object and set the margins PageDimensions dimensions = new PageDimensions( PageSize.Letter, PageOrientation.Portrait ); dimensions.BottomMargin = 50; dimensions.TopMargin = 50; dimensions.LeftMargin = 35; dimensions.RightMargin = 35;
// Create a page using a page dimensions object and add it to the document Page page = new Page( dimensions ); document.Pages.Add( page );
// Add a label to the page page.Elements.Add( new Label( "This page was rotated 90 degrees.", 0, 0, 300, 20, Font.Helvetica, 18 ) );
// Rotate the page 90 degrees page.Rotate = 90; // Save the PDF document.Draw( @"C:\MyDocument.pdf" );}
}

Remarks​

This class can be used to create pages to add to your Document .

Constructors​

Page()​

Initializes a new instance of the Page class.

public Page()
Public Sub New ()

Page(PageDimensions)​

Initializes a new instance of the Page class.

public Page(PageDimensions dimensions)
Public Sub New (dimensions As PageDimensions)

Parameters​

The PageDimensions of the page.

Page(PageSize)​

Initializes a new instance of the Page class.

public Page(PageSize size)
Public Sub New (size As PageSize)

Parameters​

The PageSize representing the dimensions of the page.

Page(PageSize, PageOrientation)​

Initializes a new instance of the Page class.

public Page(PageSize size, PageOrientation orientation)
Public Sub New (size As PageSize, orientation As PageOrientation)

Parameters​

The PageSize representing the dimensions of the page.

The PageOrientation of the page.

Page(PageSize, PageOrientation, Single)​

Initializes a new instance of the Page class.

public Page(PageSize size, PageOrientation orientation, float margins)
Public Sub New (size As PageSize, orientation As PageOrientation, margins As Single)

Parameters​

The PageSize representing the dimensions of the page.

The PageOrientation of the page.

The margins of the page.

Page(PageSize, Single)​

Initializes a new instance of the Page class.

public Page(PageSize size, float margins)
Public Sub New (size As PageSize, margins As Single)

Parameters​

The PageSize representing the dimensions of the page.

The margins of the page.

Page(Single, Single)​

Initializes a new instance of the Page class.

public Page(float width, float height)
Public Sub New (width As Single, height As Single)

Parameters​

The width of the page.

The height of the page.

Page(Single, Single, Single)​

Initializes a new instance of the Page class.

public Page(float width, float height, float margins)
Public Sub New (width As Single, height As Single, margins As Single)

Parameters​

The width of the page.

The height of the page.

The margins of the page.

Properties​

ApplyDocumentTemplate​

Gets or sets a value indicating if this page uses the documents template.

public bool ApplyDocumentTemplate { get; set; }
Public Property ApplyDocumentTemplate As Boolean

Property Value​

Boolean

ApplySectionTemplate​

Gets or sets a value indicating if this page uses the sections template.

public bool ApplySectionTemplate { get; set; }
Public Property ApplySectionTemplate As Boolean

Property Value​

Boolean

Dimensions​

Gets or sets the dimensions of the page.

public PageDimensions Dimensions { get; set; }
Public Property Dimensions As PageDimensions

Property Value​

PageDimensions

Elements​

Gets a collection of page elements.

public Group Elements { get; }
Public Property Elements As Group

Property Value​

Group

Rotate​

Gets or sets the rotation of the page.

public int Rotate { get; set; }
Public Property Rotate As Int32

Property Value​

Int32

Methods​

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

See Also​

ceTe.DynamicPDF