See Also

PageDimensions Members  | ceTe.DynamicPDF Namespace

Requirements

Namespace: ceTe.DynamicPDF

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: ceTe.DynamicPDF (in ceTe.DynamicPDF.dll)

Language

Visual Basic

C#

Show All

Represents the dimensions of a page.

For a list of all members of this type, see PageDimensions members.

Object Model



Inheritance Hierarchy

System.Object
   ceTe.DynamicPDF.AreaDimensions
      ceTe.DynamicPDF.PageDimensions
         ceTe.DynamicPDF.ExtendedPageDimensions

Syntax

[Visual Basic]
Public Class PageDimensions    Inherits AreaDimensions
[C#]
public class PageDimensions : AreaDimensions

Remarks

This class can be used to specify the dimensions and other formatting details of a page. It can then be passed into a Page constructor.

Example

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.

[Visual Basic] 

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

[C#] 

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" ); 
    } 
}

Licensing

This class is a DynamicPDF Generator Community Edition feature.

Requirements

Namespace: ceTe.DynamicPDF

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: ceTe.DynamicPDF (in ceTe.DynamicPDF.dll)

See Also

PageDimensions Members  | ceTe.DynamicPDF Namespace

 

 


© Copyright 2007, ceTe Software