Table of Contents

Class RootElement<T>

Namespace
iText.Layout
Assembly
itext.layout.dll

A generic abstract root element for a PDF layout object hierarchy.

public abstract class RootElement<T> : ElementPropertyContainer<T>, IPropertyContainer, IDisposable where T : IPropertyContainer

Type Parameters

T

this type

Inheritance
RootElement<T>
Implements
Derived
Inherited Members

Constructors

RootElement()

protected RootElement()

Fields

childElements

protected IList<IElement> childElements

Field Value

IList<IElement>

defaultFont

protected PdfFont defaultFont

Field Value

PdfFont

defaultFontProvider

protected FontProvider defaultFontProvider

Field Value

FontProvider

defaultSplitCharacters

protected ISplitCharacters defaultSplitCharacters

Field Value

ISplitCharacters

immediateFlush

protected bool immediateFlush

Field Value

bool

pdfDocument

protected PdfDocument pdfDocument

Field Value

PdfDocument

rootRenderer

protected RootRenderer rootRenderer

Field Value

RootRenderer

Methods

Add(IBlockElement)

Adds an element to the root.

public virtual T Add(IBlockElement element)

Parameters

element IBlockElement

an element with spacial margins, tabbing, and alignment

Returns

T

this element

Remarks

Adds an element to the root. The element is immediately placed in the contents.

See Also

Add(Image)

Adds an image to the root.

public virtual T Add(Image image)

Parameters

image Image

a graphical image element

Returns

T

this element

Remarks

Adds an image to the root. The element is immediately placed in the contents.

See Also

Close()

public abstract void Close()

CreateAndAddRendererSubTree(IElement)

protected virtual void CreateAndAddRendererSubTree(IElement element)

Parameters

element IElement

DeleteOwnProperty(int)

public override void DeleteOwnProperty(int property)

Parameters

property int

EnsureRootRendererNotNull()

protected abstract RootRenderer EnsureRootRendererNotNull()

Returns

RootRenderer

GetDefaultProperty<T1>(int)

public override T1 GetDefaultProperty<T1>(int property)

Parameters

property int

Returns

T1

Type Parameters

T1

GetFontProvider()

Gets FontProvider if presents.

public virtual FontProvider GetFontProvider()

Returns

FontProvider

instance of FontProvider if exists, otherwise null.

GetOwnProperty<T1>(int)

public override T1 GetOwnProperty<T1>(int property)

Parameters

property int

Returns

T1

Type Parameters

T1

GetProperty<T1>(int)

public override T1 GetProperty<T1>(int property)

Parameters

property int

Returns

T1

Type Parameters

T1

GetRenderer()

Gets the rootRenderer attribute, a specialized IRenderer that acts as the root object that other renderers descend from.

public virtual RootRenderer GetRenderer()

Returns

RootRenderer

the RootRenderer attribute

HasOwnProperty(int)

public override bool HasOwnProperty(int property)

Parameters

property int

Returns

bool

HasProperty(int)

public override bool HasProperty(int property)

Parameters

property int

Returns

bool

SetFontProvider(FontProvider)

public virtual void SetFontProvider(FontProvider fontProvider)

Parameters

fontProvider FontProvider

instance of FontProvider.

Remarks

Sets FontProvider. Note, font provider is inherited property.

SetProperty(int, object)

public override void SetProperty(int property, object value)

Parameters

property int
value object

ShowTextAligned(string, float, float, TextAlignment?)

Convenience method to write a text aligned about the specified point

public virtual T ShowTextAligned(string text, float x, float y, TextAlignment? textAlign)

Parameters

text string

text to be placed to the page

x float

the point about which the text will be aligned and rotated

y float

the point about which the text will be aligned and rotated

textAlign TextAlignment?

horizontal alignment about the specified point

Returns

T

this object

ShowTextAligned(string, float, float, TextAlignment?, VerticalAlignment?, float)

Convenience method to write a text aligned about the specified point

public virtual T ShowTextAligned(string text, float x, float y, TextAlignment? textAlign, VerticalAlignment? vertAlign, float angle)

Parameters

text string

text to be placed to the page

x float

the point about which the text will be aligned and rotated

y float

the point about which the text will be aligned and rotated

textAlign TextAlignment?

horizontal alignment about the specified point

vertAlign VerticalAlignment?

vertical alignment about the specified point

angle float

the angle of rotation applied to the text, in radians

Returns

T

this object

ShowTextAligned(string, float, float, TextAlignment?, float)

Convenience method to write a text aligned about the specified point

public virtual T ShowTextAligned(string text, float x, float y, TextAlignment? textAlign, float angle)

Parameters

text string

text to be placed to the page

x float

the point about which the text will be aligned and rotated

y float

the point about which the text will be aligned and rotated

textAlign TextAlignment?

horizontal alignment about the specified point

angle float

the angle of rotation applied to the text, in radians

Returns

T

this object

ShowTextAligned(Paragraph, float, float, int, TextAlignment?, VerticalAlignment?, float)

Convenience method to write a text aligned about the specified point

public virtual T ShowTextAligned(Paragraph p, float x, float y, int pageNumber, TextAlignment? textAlign, VerticalAlignment? vertAlign, float radAngle)

Parameters

p Paragraph

paragraph of text to be placed to the page. By default it has no leading and is written in single line. Set width to write multiline text.

x float

the point about which the text will be aligned and rotated

y float

the point about which the text will be aligned and rotated

pageNumber int

the page number to write the text

textAlign TextAlignment?

horizontal alignment about the specified point

vertAlign VerticalAlignment?

vertical alignment about the specified point

radAngle float

the angle of rotation applied to the text, in radians

Returns

T

this object

ShowTextAligned(Paragraph, float, float, TextAlignment?)

Convenience method to write a text aligned about the specified point

public virtual T ShowTextAligned(Paragraph p, float x, float y, TextAlignment? textAlign)

Parameters

p Paragraph

paragraph of text to be placed to the page. By default it has no leading and is written in single line. Set width to write multiline text.

x float

the point about which the text will be aligned and rotated

y float

the point about which the text will be aligned and rotated

textAlign TextAlignment?

horizontal alignment about the specified point

Returns

T

this object

ShowTextAligned(Paragraph, float, float, TextAlignment?, VerticalAlignment?)

Convenience method to write a text aligned about the specified point

public virtual T ShowTextAligned(Paragraph p, float x, float y, TextAlignment? textAlign, VerticalAlignment? vertAlign)

Parameters

p Paragraph

paragraph of text to be placed to the page. By default it has no leading and is written in single line. Set width to write multiline text.

x float

the point about which the text will be aligned and rotated

y float

the point about which the text will be aligned and rotated

textAlign TextAlignment?

horizontal alignment about the specified point

vertAlign VerticalAlignment?

vertical alignment about the specified point

Returns

T

this object

ShowTextAlignedKerned(string, float, float, TextAlignment?, VerticalAlignment?, float)

Convenience method to write a kerned text aligned about the specified point

public virtual T ShowTextAlignedKerned(string text, float x, float y, TextAlignment? textAlign, VerticalAlignment? vertAlign, float radAngle)

Parameters

text string

text to be placed to the page

x float

the point about which the text will be aligned and rotated

y float

the point about which the text will be aligned and rotated

textAlign TextAlignment?

horizontal alignment about the specified point

vertAlign VerticalAlignment?

vertical alignment about the specified point

radAngle float

the angle of rotation applied to the text, in radians

Returns

T

this object