iText 8.0.4 API
iText.Layout.RootElement< T > Class Template Referenceabstract

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

Inheritance diagram for iText.Layout.RootElement< T >:
iText.Layout.ElementPropertyContainer< T > iText.Commons.Actions.Sequence.AbstractIdentifiableElement iText.Layout.IPropertyContainer

Public Member Functions

virtual T  Add (IBlockElement element)
  Adds an element to the root. More...
 
virtual T  Add (Image image)
  Adds an image to the root. More...
 
virtual FontProvider  GetFontProvider ()
  Gets iText.Layout.Font.FontProvider if presents. More...
 
virtual void  SetFontProvider (FontProvider fontProvider)
  Sets iText.Layout.Font.FontProvider. More...
 
override bool  HasProperty (int property)
  Checks if this entity has the specified property. More...
 
override bool  HasOwnProperty (int property)
  Checks if this entity has the specified property, i.e. if it was set to this very element earlier More...
 
override T1  GetProperty< T1 > (int property)
  Gets the property from this entity. More...
 
override T1  GetOwnProperty< T1 > (int property)
  Gets own property from this entity. More...
 
override T1  GetDefaultProperty< T1 > (int property)
  Gets the default property from this entity. More...
 
override void  DeleteOwnProperty (int property)
  Deletes the own property of this entity. More...
 
override void  SetProperty (int property, Object value)
  Sets a property for this entity. More...
 
virtual RootRenderer  GetRenderer ()
  Gets the rootRenderer attribute, a specialized iText.Layout.Renderer.IRenderer that acts as the root object that other renderers descend from. More...
 
virtual T  ShowTextAligned (String text, float x, float y, TextAlignment? textAlign)
  Convenience method to write a text aligned about the specified point More...
 
virtual T  ShowTextAligned (String text, float x, float y, TextAlignment? textAlign, float angle)
  Convenience method to write a text aligned about the specified point More...
 
virtual T  ShowTextAligned (String text, float x, float y, TextAlignment? textAlign, VerticalAlignment? vertAlign, float angle)
  Convenience method to write a text aligned about the specified point More...
 
virtual T  ShowTextAlignedKerned (String text, float x, float y, TextAlignment? textAlign, VerticalAlignment? vertAlign, float radAngle)
  Convenience method to write a kerned text aligned about the specified point More...
 
virtual T  ShowTextAligned (Paragraph p, float x, float y, TextAlignment? textAlign)
  Convenience method to write a text aligned about the specified point More...
 
virtual T  ShowTextAligned (Paragraph p, float x, float y, TextAlignment? textAlign, VerticalAlignment? vertAlign)
  Convenience method to write a text aligned about the specified point More...
 
virtual T  ShowTextAligned (Paragraph p, float x, float y, int pageNumber, TextAlignment? textAlign, VerticalAlignment? vertAlign, float radAngle)
  Convenience method to write a text aligned about the specified point More...
 
abstract void  Close ()
 
- Public Member Functions inherited from iText.Layout.ElementPropertyContainer< T >
virtual T  SetRelativePosition (float left, float top, float right, float bottom)
  Sets values for a relative repositioning of the Element. More...
 
virtual T  SetFixedPosition (float left, float bottom, float width)
  Sets values for a absolute repositioning of the Element. More...
 
virtual T  SetFixedPosition (float left, float bottom, UnitValue width)
  Sets values for an absolute repositioning of the Element. More...
 
virtual T  SetFixedPosition (int pageNumber, float left, float bottom, float width)
  Sets values for a absolute repositioning of the Element. More...
 
virtual T  SetFixedPosition (int pageNumber, float left, float bottom, UnitValue width)
  Sets values for a absolute repositioning of the Element. More...
 
virtual T  SetHorizontalAlignment (HorizontalAlignment? horizontalAlignment)
  Sets the horizontal alignment of this Element. More...
 
virtual T  SetFont (PdfFont font)
  Sets the font of this Element. More...
 
virtual T  SetFontFamily (params String[] fontFamilyNames)
  Sets the preferable font families for this Element. More...
 
virtual T  SetFontFamily (IList< String > fontFamilyNames)
  Sets the preferable font families for this Element. More...
 
virtual T  SetFontColor (Color fontColor)
  Sets the font color of this Element. More...
 
virtual T  SetFontColor (Color fontColor, float opacity)
  Sets the font color of this Element and the opacity of the text. More...
 
virtual T  SetFontColor (TransparentColor transparentColor)
 
virtual T  SetFontSize (float fontSize)
  Sets the font size of this Element, measured in points. More...
 
virtual T  SetTextAlignment (TextAlignment? alignment)
  Sets the text alignment of this Element. More...
 
virtual T  SetCharacterSpacing (float charSpacing)
  Defines a custom spacing distance between all characters of a textual element. More...
 
virtual T  SetWordSpacing (float wordSpacing)
  Defines a custom spacing distance between words of a textual element. More...
 
virtual T  SetFontKerning (FontKerning fontKerning)
  Enable or disable kerning. More...
 
virtual T  SetBackgroundColor (Color backgroundColor)
  Specifies a background color for the Element. More...
 
virtual T  SetBackgroundColor (Color backgroundColor, float opacity)
  Specifies a background color for the Element. More...
 
virtual T  SetBackgroundColor (Color backgroundColor, float extraLeft, float extraTop, float extraRight, float extraBottom)
  Specifies a background color for the Element, and extra space that must be counted as part of the background and therefore colored. More...
 
virtual T  SetBackgroundColor (Color backgroundColor, float opacity, float extraLeft, float extraTop, float extraRight, float extraBottom)
  Specifies a background color for the Element, and extra space that must be counted as part of the background and therefore colored. More...
 
virtual T  SetBackgroundImage (BackgroundImage image)
  Specifies a background image for the Element. More...
 
virtual T  SetBackgroundImage (IList< BackgroundImage > imagesList)
  Specifies a list of background images for the Element. More...
 
virtual T  SetBorder (Border border)
  Sets a border for all four edges of this Element with customizable color, width, pattern type. More...
 
virtual T  SetBorderTop (Border border)
  Sets a border for the upper limit of this Element with customizable color, width, pattern type. More...
 
virtual T  SetBorderRight (Border border)
  Sets a border for the right limit of this Element with customizable color, width, pattern type. More...
 
virtual T  SetBorderBottom (Border border)
  Sets a border for the bottom limit of this Element with customizable color, width, pattern type. More...
 
virtual T  SetBorderLeft (Border border)
  Sets a border for the left limit of this Element with customizable color, width, pattern type. More...
 
virtual T  SetBorderRadius (BorderRadius borderRadius)
  Sets a border radius for all four edges of this Element. More...
 
virtual T  SetBorderBottomLeftRadius (BorderRadius borderRadius)
  Sets a border radius for the bottom left corner of this Element. More...
 
virtual T  SetBorderBottomRightRadius (BorderRadius borderRadius)
  Sets a border radius for the bottom right corner of this Element. More...
 
virtual T  SetBorderTopLeftRadius (BorderRadius borderRadius)
  Sets a border radius for the top left corner of this Element. More...
 
virtual T  SetBorderTopRightRadius (BorderRadius borderRadius)
  Sets a border radius for the top right corner of this Element. More...
 
virtual T  SetSplitCharacters (ISplitCharacters splitCharacters)
  Sets a rule for splitting strings when they don't fit into one line. More...
 
virtual ISplitCharacters  GetSplitCharacters ()
  Gets a rule for splitting strings when they don't fit into one line. More...
 
virtual ? int  GetTextRenderingMode ()
  Gets the text rendering mode, a variable that determines whether showing text causes glyph outlines to be stroked, filled, used as a clipping boundary, or some combination of the three. More...
 
virtual T  SetTextRenderingMode (int textRenderingMode)
  Sets the text rendering mode, a variable that determines whether showing text causes glyph outlines to be stroked, filled, used as a clipping boundary, or some combination of the three. More...
 
virtual Color  GetStrokeColor ()
  Gets the stroke color for the current element. More...
 
virtual T  SetStrokeColor (Color strokeColor)
  Sets the stroke color for the current element. More...
 
virtual ? float  GetStrokeWidth ()
  Gets the stroke width for the current element. More...
 
virtual T  SetStrokeWidth (float strokeWidth)
  Sets the stroke width for the current element. More...
 
virtual T  SetBold ()
  Switch on the simulation of bold style for a font. More...
 
virtual T  SetItalic ()
  Switch on the simulation of italic style for a font. More...
 
virtual T  SetLineThrough ()
  Sets default line-through attributes for text. More...
 
virtual T  SetUnderline ()
  Sets default underline attributes for text. More...
 
virtual T  SetUnderline (float thickness, float yPosition)
  Sets an horizontal line that can be an underline or a strikethrough. More...
 
virtual T  SetUnderline (Color color, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle)
  Sets an horizontal line that can be an underline or a strikethrough. More...
 
virtual T  SetUnderline (Color color, float opacity, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle)
  Sets an horizontal line that can be an underline or a strikethrough. More...
 
virtual T  SetBaseDirection (BaseDirection? baseDirection)
  This attribute specifies the base direction of directionally neutral text (i.e., text that doesn't have inherent directionality as defined in Unicode) in an element's content and attribute values. More...
 
virtual T  SetHyphenation (HyphenationConfig hyphenationConfig)
  Sets a custom hyphenation configuration which will hyphenate words automatically accordingly to the language and country. More...
 
virtual T  SetFontScript (UnicodeScript? script)
  Sets the writing system for this text element. More...
 
virtual T  SetDestination (String destination)
  Sets a destination name that will be created when this element is drawn to content. More...
 
virtual T  SetOpacity (float? opacity)
  Sets an opacity of the given element. More...
 

Detailed Description

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

Template Parameters
T this type
Type Constraints
T  : IPropertyContainer  

Member Function Documentation

◆ Add() [1/2]

virtual T iText.Layout.RootElement< T >.Add ( IBlockElement  element )
inlinevirtual

Adds an element to the root.

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

Parameters
element an element with spacial margins, tabbing, and alignment
Returns
this element
See also
iText.Layout.Element.BlockElement

◆ Add() [2/2]

virtual T iText.Layout.RootElement< T >.Add ( Image  image )
inlinevirtual

Adds an image to the root.

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

Parameters
image a graphical image element
Returns
this element
See also
iText.Layout.Element.Image

◆ DeleteOwnProperty()

override void iText.Layout.RootElement< T >.DeleteOwnProperty ( int  property )
inlinevirtual

Deletes the own property of this entity.

Parameters
property the property to be deleted

Reimplemented from iText.Layout.ElementPropertyContainer< T >.

◆ GetDefaultProperty< T1 >()

override T1 iText.Layout.RootElement< T >.GetDefaultProperty< T1 > ( int  property )
inlinevirtual

Gets the default property from this entity.

Template Parameters
T1 the return type associated with the property
Parameters
property the property to be retrieved
Returns
the default property value. If the default property is not defined, null will be returned

Reimplemented from iText.Layout.ElementPropertyContainer< T >.

◆ GetFontProvider()

virtual FontProvider iText.Layout.RootElement< T >.GetFontProvider ( )
inlinevirtual

Gets iText.Layout.Font.FontProvider if presents.

Returns
instance of iText.Layout.Font.FontProvider if exists, otherwise null.

◆ GetOwnProperty< T1 >()

override T1 iText.Layout.RootElement< T >.GetOwnProperty< T1 > ( int  property )
inlinevirtual

Gets own property from this entity.

Gets own property from this entity. The property must have been set earlier to this entity. If the property is not found, null will be returned.

Template Parameters
T1 the return type associated with the property
Parameters
property the property to be retrieved
Returns
the value of the given own property. null will be returned if the property value was not found

Reimplemented from iText.Layout.ElementPropertyContainer< T >.

◆ GetProperty< T1 >()

override T1 iText.Layout.RootElement< T >.GetProperty< T1 > ( int  property )
inlinevirtual

Gets the property from this entity.

Gets the property from this entity. Compared to GetOwnProperty(int) , this method can check parent's properties, styles, etc, depending on the origin of the instance

Template Parameters
T1 the return type associated with the property
Parameters
property the property to be retrieved
Returns
the value of the given property. null will be returned if the property value was not found

Reimplemented from iText.Layout.ElementPropertyContainer< T >.

◆ GetRenderer()

virtual RootRenderer iText.Layout.RootElement< T >.GetRenderer ( )
inlinevirtual

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

Returns
the iText.Layout.Renderer.RootRenderer attribute

◆ HasOwnProperty()

override bool iText.Layout.RootElement< T >.HasOwnProperty ( int  property )
inlinevirtual

Checks if this entity has the specified property, i.e. if it was set to this very element earlier

Parameters
property the property to be checked
Returns

true if this instance has given own property, false otherwise

Reimplemented from iText.Layout.ElementPropertyContainer< T >.

◆ HasProperty()

override bool iText.Layout.RootElement< T >.HasProperty ( int  property )
inlinevirtual

Checks if this entity has the specified property.

Checks if this entity has the specified property. Compared to HasOwnProperty(int) , this method can check parent's properties, styles, etc, depending on the origin of the instance

Parameters
property the property to be checked
Returns

true if this instance has given property, false otherwise

Reimplemented from iText.Layout.ElementPropertyContainer< T >.

◆ SetFontProvider()

virtual void iText.Layout.RootElement< T >.SetFontProvider ( FontProvider  fontProvider )
inlinevirtual

Sets iText.Layout.Font.FontProvider.

Sets iText.Layout.Font.FontProvider. Note, font provider is inherited property.

Parameters
fontProvider instance of iText.Layout.Font.FontProvider.

◆ SetProperty()

override void iText.Layout.RootElement< T >.SetProperty ( int  property,
Object  value 
)
inlinevirtual

Sets a property for this entity.

Parameters
property the property to be set
value the value of the property

Reimplemented from iText.Layout.ElementPropertyContainer< T >.

◆ ShowTextAligned() [1/6]

virtual T iText.Layout.RootElement< T >.ShowTextAligned ( Paragraph  p,
float  x,
float  y,
int  pageNumber,
TextAlignment textAlign,
VerticalAlignment vertAlign,
float  radAngle 
)
inlinevirtual

Convenience method to write a text aligned about the specified point

Parameters
p 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 the point about which the text will be aligned and rotated
y the point about which the text will be aligned and rotated
pageNumber the page number to write the text
textAlign horizontal alignment about the specified point
vertAlign vertical alignment about the specified point
radAngle the angle of rotation applied to the text, in radians
Returns
this object

◆ ShowTextAligned() [2/6]

virtual T iText.Layout.RootElement< T >.ShowTextAligned ( Paragraph  p,
float  x,
float  y,
TextAlignment textAlign 
)
inlinevirtual

Convenience method to write a text aligned about the specified point

Parameters
p 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 the point about which the text will be aligned and rotated
y the point about which the text will be aligned and rotated
textAlign horizontal alignment about the specified point
Returns
this object

◆ ShowTextAligned() [3/6]

virtual T iText.Layout.RootElement< T >.ShowTextAligned ( Paragraph  p,
float  x,
float  y,
TextAlignment textAlign,
VerticalAlignment vertAlign 
)
inlinevirtual

Convenience method to write a text aligned about the specified point

Parameters
p 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 the point about which the text will be aligned and rotated
y the point about which the text will be aligned and rotated
textAlign horizontal alignment about the specified point
vertAlign vertical alignment about the specified point
Returns
this object

◆ ShowTextAligned() [4/6]

virtual T iText.Layout.RootElement< T >.ShowTextAligned ( String  text,
float  x,
float  y,
TextAlignment textAlign 
)
inlinevirtual

Convenience method to write a text aligned about the specified point

Parameters
text text to be placed to the page
x the point about which the text will be aligned and rotated
y the point about which the text will be aligned and rotated
textAlign horizontal alignment about the specified point
Returns
this object

◆ ShowTextAligned() [5/6]

virtual T iText.Layout.RootElement< T >.ShowTextAligned ( String  text,
float  x,
float  y,
TextAlignment textAlign,
float  angle 
)
inlinevirtual

Convenience method to write a text aligned about the specified point

Parameters
text text to be placed to the page
x the point about which the text will be aligned and rotated
y the point about which the text will be aligned and rotated
textAlign horizontal alignment about the specified point
angle the angle of rotation applied to the text, in radians
Returns
this object

◆ ShowTextAligned() [6/6]

virtual T iText.Layout.RootElement< T >.ShowTextAligned ( String  text,
float  x,
float  y,
TextAlignment textAlign,
VerticalAlignment vertAlign,
float  angle 
)
inlinevirtual

Convenience method to write a text aligned about the specified point

Parameters
text text to be placed to the page
x the point about which the text will be aligned and rotated
y the point about which the text will be aligned and rotated
textAlign horizontal alignment about the specified point
vertAlign vertical alignment about the specified point
angle the angle of rotation applied to the text, in radians
Returns
this object

◆ ShowTextAlignedKerned()

virtual T iText.Layout.RootElement< T >.ShowTextAlignedKerned ( String  text,
float  x,
float  y,
TextAlignment textAlign,
VerticalAlignment vertAlign,
float  radAngle 
)
inlinevirtual

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

Parameters
text text to be placed to the page
x the point about which the text will be aligned and rotated
y the point about which the text will be aligned and rotated
textAlign horizontal alignment about the specified point
vertAlign vertical alignment about the specified point
radAngle the angle of rotation applied to the text, in radians
Returns
this object