Table of Contents

Class AbstractElement<T>

Namespace
iText.Layout.Element
Assembly
itext.layout.dll

Defines the most common properties that most IElement implementations share.

public abstract class AbstractElement<T> : ElementPropertyContainer<T>, IAbstractElement, IElement, IPropertyContainer where T : IElement

Type Parameters

T

the type of the implementation

Inheritance
AbstractElement<T>
Implements
Derived
Inherited Members

Constructors

AbstractElement()

protected AbstractElement()

Fields

childElements

protected IList<IElement> childElements

Field Value

IList<IElement>

nextRenderer

protected IRenderer nextRenderer

Field Value

IRenderer

styles

protected ICollection<Style> styles

Field Value

ICollection<Style>

Methods

AddStyle(Style)

Add a new style to this element.

public virtual T AddStyle(Style style)

Parameters

style Style

the style to be added

Returns

T

this element

Remarks

Add a new style to this element. A style can be used as an effective way to define multiple equal properties to several elements, however its properties have lower priority than properties, directly set on ElementPropertyContainer<T> Note that if several Style objects are added, iText checks them one by one in the order in which they were added and returns the property's value from the last Style object, which contains this property. So, if there are two Style objects added: the first has set width of 100 points and the second of 200 points, iText will get 200 points as width value.

CreateRendererSubTree()

public virtual IRenderer CreateRendererSubTree()

Returns

IRenderer

GetChildren()

Gets the child elements of this elements

public virtual IList<IElement> GetChildren()

Returns

IList<IElement>

a list of children

GetProperty<T1>(int)

public override T1 GetProperty<T1>(int property)

Parameters

property int

Returns

T1

Type Parameters

T1

GetRenderer()

public virtual IRenderer GetRenderer()

Returns

IRenderer

HasProperty(int)

public override bool HasProperty(int property)

Parameters

property int

Returns

bool

IsEmpty()

Returns true if this list contains no elements.

public virtual bool IsEmpty()

Returns

bool

true if this list contains no elements

MakeNewRenderer()

Creates new renderer instance.

protected abstract IRenderer MakeNewRenderer()

Returns

IRenderer

new IRenderer

SetAction(PdfAction)

Sets an action on this Element.

public virtual T SetAction(PdfAction action)

Parameters

action PdfAction

the PdfAction that should be performed

Returns

T

this Element

Remarks

Sets an action on this Element. An action is a general PDF concept that signifies anything that makes the document interactive, e.g. a hyperlink or a button.

SetNextRenderer(IRenderer)

public virtual void SetNextRenderer(IRenderer renderer)

Parameters

renderer IRenderer

SetPageNumber(int)

Explicitly sets the page number this element should be put on.

public virtual T SetPageNumber(int pageNumber)

Parameters

pageNumber int

the page number of the page this element should be placed on

Returns

T

this Element

Remarks

Explicitly sets the page number this element should be put on. The location on the page will be the same as if it were added at the end of the document, but it will be located on the specified page.

This method should be used very carefully in client code.