Class RootElement<T>
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
defaultFont
protected PdfFont defaultFont
Field Value
defaultFontProvider
protected FontProvider defaultFontProvider
Field Value
defaultSplitCharacters
protected ISplitCharacters defaultSplitCharacters
Field Value
immediateFlush
protected bool immediateFlush
Field Value
pdfDocument
protected PdfDocument pdfDocument
Field Value
rootRenderer
protected RootRenderer rootRenderer
Field Value
Methods
Add(IBlockElement)
Adds an element to the root.
public virtual T Add(IBlockElement element)
Parameters
element
IBlockElementan 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
-
BlockElement<T>
Add(Image)
Adds an image to the root.
public virtual T Add(Image image)
Parameters
image
Imagea 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
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
HasProperty(int)
public override bool HasProperty(int property)
Parameters
property
int
Returns
SetFontProvider(FontProvider)
Sets FontProvider.
public virtual void SetFontProvider(FontProvider fontProvider)
Parameters
fontProvider
FontProviderinstance of FontProvider.
Remarks
Sets FontProvider. Note, font provider is inherited property.
SetProperty(int, object)
public override void SetProperty(int property, object value)
Parameters
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
stringtext to be placed to the page
x
floatthe point about which the text will be aligned and rotated
y
floatthe 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
stringtext to be placed to the page
x
floatthe point about which the text will be aligned and rotated
y
floatthe 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
floatthe 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
stringtext to be placed to the page
x
floatthe point about which the text will be aligned and rotated
y
floatthe point about which the text will be aligned and rotated
textAlign
TextAlignment?horizontal alignment about the specified point
angle
floatthe 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
Paragraphparagraph 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
floatthe point about which the text will be aligned and rotated
y
floatthe point about which the text will be aligned and rotated
pageNumber
intthe page number to write the text
textAlign
TextAlignment?horizontal alignment about the specified point
vertAlign
VerticalAlignment?vertical alignment about the specified point
radAngle
floatthe 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
Paragraphparagraph 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
floatthe point about which the text will be aligned and rotated
y
floatthe 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
Paragraphparagraph 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
floatthe point about which the text will be aligned and rotated
y
floatthe 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
stringtext to be placed to the page
x
floatthe point about which the text will be aligned and rotated
y
floatthe 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
floatthe angle of rotation applied to the text, in radians
Returns
- T
this object