Skip to main content

AnchorGroup

Version: 12.0

cete.dynamicpdf.pageelements.anchorgroup

AnchorGroup​

Represents a group of elements that will be anchored.

public class AnchorGroup : Group, IEnumerable, IPageElementContainer, ISerializable
Public Class AnchorGroup
Inherits Group
Implements IEnumerable, IPageElementContainer, ISerializable

Inheritance: Object → PageElement → Group → AnchorGroup

Implements: IEnumerable, IPageElementContainer, ISerializable

Licensing Info​

This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Constructors​

AnchorGroup(Single, Single, Align, VAlign)​

Initializes a new instance of the AnchorGroup class.

public AnchorGroup(float width, float height, Align align, VAlign vAlign)
Public Sub New (width As Single, height As Single, align As Align, vAlign As VAlign)

Parameters​

Width of the anchor group.

Height of the anchor group.

Alignment of the anchor group.

Vertical Alignment of the anchor group.

Licensing Info​

This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Properties​

Align​

Gets or sets the alignment of the anchor group.

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

Property Value​

Align

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

AnchorTo​

Gets or sets the AnchorTo object to use for the anchor group.

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

Property Value​

AnchorTo

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Count​

Gets the number of page elements in the group. (Inherited from Group)

public int Count { get; }
Public Property Count As Int32

Property Value​

Int32

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Height​

Gets or sets the height of the anchor group.

public float Height { get; set; }
Public Property Height As Single

Property Value​

Single

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

ID​

Gets or sets the ID of the page element. (Inherited from PageElement)

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

Property Value​

String

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

IgnoreMargins​

Gets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property. (Inherited from PageElement)

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

Property Value​

Boolean

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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

Item[Int32]​

Gets the PageElement object at the given index. (Inherited from Group)

public PageElement this[int index] { get; }
Public Property Item(index As Integer) As PageElement

Property Value​

PageElement

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Item[String]​

Gets the PageElement object with the given ID. (Inherited from Group)

public PageElement this[string id] { get; }
Public Property Item(id As String) As PageElement

Property Value​

PageElement

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

RelativeTo​

Gets and sets placement of the page element on the page. (Inherited from PageElement)

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

Property Value​

RelativeTo

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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

VAlign​

Gets or sets the vertical alignment of the anchor group.

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

Property Value​

VAlign

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Width​

Gets or sets the width of the anchor group.

public float Width { get; set; }
Public Property Width As Single

Property Value​

Single

Licensing Info​

This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Methods​

Add(PageElement)​

Adds a page element to the group. (Inherited from Group)

public void Add(PageElement pageElement)
Sub Add(pageElement As PageElement)

Parameters​

PageElement object to add to the group.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Draw(PageWriter)​

Draws the anchor group to the given PageWriter object.

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

Parameters​

PageWriter object to receive the anchor group's output.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

GetEnumerator()​

Returns an enumerator that can iterate through the Group . (Inherited from Group)

public IEnumerator GetEnumerator()
Function GetEnumerator() As IEnumerator

Returns​

An IEnumerator for the entire Group

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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 .

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

GetPageElementByID(String)​

Returns a page element with the given ID. (Inherited from Group)

public PageElement GetPageElementByID(string id)
Function GetPageElementByID(id As String) As PageElement

Parameters​

ID of the page element to find.

Returns​

PageElement with the given ID.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Insert(Int32, PageElement)​

Inserts a page element to the group. (Inherited from Group)

public void Insert(int index, PageElement pageElement)
Sub Insert(index As Integer, pageElement As PageElement)

Parameters​

The Zero-based index it which the page element should be inserted.

PageElement object to insert in the group.

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

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 .

Licensing Info​

This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

See Also​

ceTe.DynamicPDF.PageElements