Skip to main content

PageElement

Version: 11.0

cete.dynamicpdf.pageelement

PageElement​

Base class from which all page elements are derived.

public abstract class PageElement : ISerializable
Public MustInherit Class PageElement
Implements ISerializable

Inheritance: Object → PageElement

Implements: ISerializable

Derived: LayoutTextArea, ImportedPageArea, ImportedPageData, AnchorGroup, AreaGroup, BackgroundImage, AustraliaPost, Aztec, BarCode, Codabar, Code11, Code128, Code25, Code39, Code93, DataMatrixBarcode, DeutschePostIdentcode, DeutschePostLeitcode, Dim2Barcode, Ean13, Ean13Sup2, Ean13Sup5, Ean14, Ean8, Ean8Sup2, Ean8Sup5, GS1DataBar, Iata25, IntelligentMailBarCode, Interleaved25, Isbn, IsbnSup2, IsbnSup5, Ismn, IsmnSup2, IsmnSup5, Issn, IssnSup2, IssnSup5, Itf14, Kix, MacroPdf417, MsiBarcode, Pdf417, Postnet, QrCode, Rm4scc, SingaporePost, StackedGS1DataBar, TextBarCode, UpcBase, UpcVersionA, UpcVersionASup2, UpcVersionASup5, UpcVersionE, UpcVersionESup2, UpcVersionESup5, Bookmark, Chart, Circle, ContentArea, FormattedTextArea, Button, CheckBox, ChoiceField, ComboBox, FormElement, ListBox, RadioButton, Signature, TextField, Group, HtmlArea, Image, ImageWatermark, Label, LayoutGrid, Line, Link, List, Note, OrderedList, PageNumberingLabel, Path, Rectangle, RotatingPageElement, Table2, TaggablePageElement, TextArea, TextWatermark, TransformationGroup, TransparencyGroup, UnorderedList, Watermark

Properties​

ID​

Gets or sets the ID of the page element.

public string ID { get; set; }
Public Property ID As String

Property Value​

String

IgnoreMargins​

Gets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property.

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

Property Value​

Boolean

Examples​

The following example will place the Label in the top-left of the page with IgnoreMargin

using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();

// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add(page); // Create an Label and place it in page top left with margin ignored
Label label = new Label("I am placed in Page top left with margin ignored", 0, 0, 160, 30);
label.RelativeTo = RelativeTo.TopLeft;
label.IgnoreMargin=true; page.Elements.Add(label);

// Save the PDF
document.Draw(outputPath);
}
}

RelativeTo​

Gets and sets placement of the page element on the page.

public RelativeTo RelativeTo { get; set; }
Public Property RelativeTo As RelativeTo

Property Value​

RelativeTo

Examples​

The following example will place the Label in the top-left of the page.

using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();

// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add(page); // Create an Label and place it in page top left with margin
Label label = new Label("I am placed in Page top left with margin.", 0, 0, 160, 30);
label.RelativeTo = RelativeTo.TopLeft;
page.Elements.Add(label);

// Save the PDF
document.Draw(outputPath);
}
}

Methods​

Draw(PageWriter)​

Draws the page element to the given PageWriter class.

public abstract void Draw(PageWriter writer)
MustOverride Sub Draw(writer As PageWriter)

Parameters​

PageWriter class to receive the page elements output.

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