iText 8.0.5 API
iText.Layout.ElementPropertyContainer< T > Class Template Reference

A generic abstract element that fits in a PDF layout object hierarchy. More...

Inheritance diagram for iText.Layout.ElementPropertyContainer< T >:
iText.Commons.Actions.Sequence.AbstractIdentifiableElement iText.Layout.IPropertyContainer iText.Layout.Element.AbstractElement< T > iText.Layout.RootElement< T > iText.Forms.Form.Element.FormField< T > iText.Layout.Element.BlockElement< T >

Public Member Functions

virtual void  SetProperty (int property, Object value)
  Sets a property for this entity. More...
 
virtual bool  HasProperty (int property)
  Checks if this entity has the specified property. More...
 
virtual bool  HasOwnProperty (int property)
  Checks if this entity has the specified property, i.e. if it was set to this very element earlier More...
 
virtual void  DeleteOwnProperty (int property)
  Deletes the own property of this entity. More...
 
virtual T1  GetProperty< T1 > (int property)
  Gets the property from this entity. More...
 
virtual T1  GetOwnProperty< T1 > (int property)
  Gets own property from this entity. More...
 
virtual T1  GetDefaultProperty< T1 > (int property)
  Gets the default property from this entity. More...
 
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...
 

Package Attributes

IDictionary< int, Object >  properties = new Dictionary()
 

Detailed Description

A generic abstract element that fits in a PDF layout object hierarchy.

A generic abstract element that fits in a PDF layout object hierarchy. A superclass of all layout object implementations.

Template Parameters
T this type
Type Constraints
T  : IPropertyContainer  

Member Function Documentation

◆ DeleteOwnProperty()

virtual void iText.Layout.ElementPropertyContainer< T >.DeleteOwnProperty ( int  property )
inlinevirtual

Deletes the own property of this entity.

Parameters
property the property to be deleted

Implements iText.Layout.IPropertyContainer.

Reimplemented in iText.Layout.RootElement< T >.

◆ GetDefaultProperty< T1 >()

virtual T1 iText.Layout.ElementPropertyContainer< 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

Implements iText.Layout.IPropertyContainer.

Reimplemented in iText.Forms.Form.Element.FormField< T >, iText.Layout.RootElement< T >, and iText.Layout.Element.BlockElement< T >.

◆ GetOwnProperty< T1 >()

virtual T1 iText.Layout.ElementPropertyContainer< 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

Implements iText.Layout.IPropertyContainer.

Reimplemented in iText.Layout.RootElement< T >.

◆ GetProperty< T1 >()

virtual T1 iText.Layout.ElementPropertyContainer< 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

Implements iText.Layout.IPropertyContainer.

Reimplemented in iText.Layout.RootElement< T >, and iText.Layout.Element.AbstractElement< T >.

◆ GetSplitCharacters()

virtual ISplitCharacters iText.Layout.ElementPropertyContainer< T >.GetSplitCharacters ( )
inlinevirtual

Gets a rule for splitting strings when they don't fit into one line.

Returns
the current string splitting rule, an implementation of iText.Layout.Splitting.ISplitCharacters

◆ GetStrokeColor()

virtual Color iText.Layout.ElementPropertyContainer< T >.GetStrokeColor ( )
inlinevirtual

Gets the stroke color for the current element.

Gets the stroke color for the current element. The stroke color is the color of the outlines or edges of a shape.

Returns
the current stroke color

◆ GetStrokeWidth()

virtual ? float iText.Layout.ElementPropertyContainer< T >.GetStrokeWidth ( )
inlinevirtual

Gets the stroke width for the current element.

Gets the stroke width for the current element. The stroke width is the width of the outlines or edges of a shape.

Returns
the current stroke width

◆ GetTextRenderingMode()

virtual ? int iText.Layout.ElementPropertyContainer< T >.GetTextRenderingMode ( )
inlinevirtual

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.

Returns
the current text rendering mode
See also
iText.Kernel.Pdf.Canvas.PdfCanvasConstants.TextRenderingMode

◆ HasOwnProperty()

virtual bool iText.Layout.ElementPropertyContainer< 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

Implements iText.Layout.IPropertyContainer.

Reimplemented in iText.Layout.RootElement< T >.

◆ HasProperty()

virtual bool iText.Layout.ElementPropertyContainer< 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

Implements iText.Layout.IPropertyContainer.

Reimplemented in iText.Layout.RootElement< T >, and iText.Layout.Element.AbstractElement< T >.

◆ SetBackgroundColor() [1/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetBackgroundColor ( Color  backgroundColor )
inlinevirtual

Specifies a background color for the Element.

Parameters
backgroundColor the background color
Returns
this Element.

◆ SetBackgroundColor() [2/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetBackgroundColor ( Color  backgroundColor,
float  extraLeft,
float  extraTop,
float  extraRight,
float  extraBottom 
)
inlinevirtual

Specifies a background color for the Element, and extra space that must be counted as part of the background and therefore colored.

Parameters
backgroundColor the background color
extraLeft extra coloring to the left side
extraTop extra coloring at the top
extraRight extra coloring to the right side
extraBottom extra coloring at the bottom
Returns
this Element.

◆ SetBackgroundColor() [3/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetBackgroundColor ( Color  backgroundColor,
float  opacity 
)
inlinevirtual

Specifies a background color for the Element.

Parameters
backgroundColor the background color
opacity the background color opacity; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent.
Returns
this Element.

◆ SetBackgroundColor() [4/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetBackgroundColor ( Color  backgroundColor,
float  opacity,
float  extraLeft,
float  extraTop,
float  extraRight,
float  extraBottom 
)
inlinevirtual

Specifies a background color for the Element, and extra space that must be counted as part of the background and therefore colored.

Parameters
backgroundColor the background color
opacity the background color opacity; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
extraLeft extra coloring to the left side
extraTop extra coloring at the top
extraRight extra coloring to the right side
extraBottom extra coloring at the bottom
Returns
this Element.

◆ SetBackgroundImage() [1/2]

virtual T iText.Layout.ElementPropertyContainer< T >.SetBackgroundImage ( BackgroundImage  image )
inlinevirtual

Specifies a background image for the Element.

Parameters
image

iText.Layout.Properties.BackgroundImage

Returns
this Element.

◆ SetBackgroundImage() [2/2]

virtual T iText.Layout.ElementPropertyContainer< T >.SetBackgroundImage ( IList< BackgroundImage imagesList )
inlinevirtual

Specifies a list of background images for the Element.

Parameters
imagesList List of iText.Layout.Properties.BackgroundImage
Returns
this Element.

◆ SetBaseDirection()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBaseDirection ( BaseDirection baseDirection )
inlinevirtual

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.

Parameters
baseDirection base direction
Returns
this element

◆ SetBold()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBold ( )
inlinevirtual

Switch on the simulation of bold style for a font.

Switch on the simulation of bold style for a font. Be aware that using correct bold font is highly preferred over this option.

Returns
this element

◆ SetBorder()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBorder ( Border  border )
inlinevirtual

Sets a border for all four edges of this Element with customizable color, width, pattern type.

Parameters
border a customized iText.Layout.Borders.Border
Returns
this Element.

◆ SetBorderBottom()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBorderBottom ( Border  border )
inlinevirtual

Sets a border for the bottom limit of this Element with customizable color, width, pattern type.

Parameters
border a customized iText.Layout.Borders.Border
Returns
this Element.

◆ SetBorderBottomLeftRadius()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBorderBottomLeftRadius ( BorderRadius  borderRadius )
inlinevirtual

Sets a border radius for the bottom left corner of this Element.

Parameters
borderRadius a customized iText.Layout.Properties.BorderRadius
Returns
this Element.

◆ SetBorderBottomRightRadius()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBorderBottomRightRadius ( BorderRadius  borderRadius )
inlinevirtual

Sets a border radius for the bottom right corner of this Element.

Parameters
borderRadius a customized iText.Layout.Properties.BorderRadius
Returns
this Element.

◆ SetBorderLeft()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBorderLeft ( Border  border )
inlinevirtual

Sets a border for the left limit of this Element with customizable color, width, pattern type.

Parameters
border a customized iText.Layout.Borders.Border
Returns
this Element.

◆ SetBorderRadius()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBorderRadius ( BorderRadius  borderRadius )
inlinevirtual

Sets a border radius for all four edges of this Element.

Parameters
borderRadius a customized iText.Layout.Properties.BorderRadius
Returns
this Element.

◆ SetBorderRight()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBorderRight ( Border  border )
inlinevirtual

Sets a border for the right limit of this Element with customizable color, width, pattern type.

Parameters
border a customized iText.Layout.Borders.Border
Returns
this Element.

◆ SetBorderTop()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBorderTop ( Border  border )
inlinevirtual

Sets a border for the upper limit of this Element with customizable color, width, pattern type.

Parameters
border a customized iText.Layout.Borders.Border
Returns
this Element.

◆ SetBorderTopLeftRadius()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBorderTopLeftRadius ( BorderRadius  borderRadius )
inlinevirtual

Sets a border radius for the top left corner of this Element.

Parameters
borderRadius a customized iText.Layout.Properties.BorderRadius
Returns
this Element.

◆ SetBorderTopRightRadius()

virtual T iText.Layout.ElementPropertyContainer< T >.SetBorderTopRightRadius ( BorderRadius  borderRadius )
inlinevirtual

Sets a border radius for the top right corner of this Element.

Parameters
borderRadius a customized iText.Layout.Properties.BorderRadius
Returns
this Element.

◆ SetCharacterSpacing()

virtual T iText.Layout.ElementPropertyContainer< T >.SetCharacterSpacing ( float  charSpacing )
inlinevirtual

Defines a custom spacing distance between all characters of a textual element.

Defines a custom spacing distance between all characters of a textual element. The character-spacing parameter is added to the glyph's horizontal or vertical displacement (depending on the writing mode).

Parameters
charSpacing a floating point value
Returns
this Element.

◆ SetDestination()

virtual T iText.Layout.ElementPropertyContainer< T >.SetDestination ( String  destination )
inlinevirtual

Sets a destination name that will be created when this element is drawn to content.

Parameters
destination the destination name to be created
Returns
this Element.

◆ SetFixedPosition() [1/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetFixedPosition ( float  left,
float  bottom,
float  width 
)
inlinevirtual

Sets values for a absolute repositioning of the Element.

Sets values for a absolute repositioning of the Element. The coordinates specified correspond to the bottom-left corner of the element and it grows upwards. Also has as a side effect that the Element's iText.Layout.Properties.Property.POSITION is changed to fixed.

Parameters
left horizontal position of the bottom-left corner on the page
bottom vertical position of the bottom-left corner on the page
width a floating point value measured in points.
Returns
this Element.

◆ SetFixedPosition() [2/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetFixedPosition ( float  left,
float  bottom,
UnitValue  width 
)
inlinevirtual

Sets values for an absolute repositioning of the Element.

Sets values for an absolute repositioning of the Element. The coordinates specified correspond to the bottom-left corner of the element, and it grows upwards. Also has as a side effect that the Element's iText.Layout.Properties.Property.POSITION is changed to fixed.

Parameters
left horizontal position of the bottom-left corner on the page
bottom vertical position of the bottom-left corner on the page
width a iText.Layout.Properties.UnitValue
Returns
this Element.

◆ SetFixedPosition() [3/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetFixedPosition ( int  pageNumber,
float  left,
float  bottom,
float  width 
)
inlinevirtual

Sets values for a absolute repositioning of the Element.

Sets values for a absolute repositioning of the Element. The coordinates specified correspond to the bottom-left corner of the element and it grows upwards. Also has as a side effect that the Element's iText.Layout.Properties.Property.POSITION is changed to fixed.

Parameters
pageNumber the page where the element must be positioned
left horizontal position of the bottom-left corner on the page
bottom vertical position of the bottom-left corner on the page
width a floating point value measured in points.
Returns
this Element.

◆ SetFixedPosition() [4/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetFixedPosition ( int  pageNumber,
float  left,
float  bottom,
UnitValue  width 
)
inlinevirtual

Sets values for a absolute repositioning of the Element.

Sets values for a absolute repositioning of the Element. The coordinates specified correspond to the bottom-left corner of the element and it grows upwards. Also has as a side effect that the Element's iText.Layout.Properties.Property.POSITION is changed to fixed.

Parameters
pageNumber the page where the element must be positioned
left horizontal position of the bottom-left corner on the page
bottom vertical position of the bottom-left corner on the page
width a floating point value measured in points.
Returns
this Element.

◆ SetFont()

virtual T iText.Layout.ElementPropertyContainer< T >.SetFont ( PdfFont  font )
inlinevirtual

Sets the font of this Element.

Sets the font of this Element.

This property overrides the value set by ElementPropertyContainer.SetFontFamily(System.String[]) . Font is set either via exact iText.Kernel.Font.PdfFont instance or via font-family name that should correspond to the font in iText.Layout.Font.FontProvider , but not both.

Parameters
font a font
Returns
this Element.

◆ SetFontColor() [1/2]

virtual T iText.Layout.ElementPropertyContainer< T >.SetFontColor ( Color  fontColor )
inlinevirtual

Sets the font color of this Element.

Parameters
fontColor a iText.Kernel.Colors.Color for the text in this Element.
Returns
this Element.

◆ SetFontColor() [2/2]

virtual T iText.Layout.ElementPropertyContainer< T >.SetFontColor ( Color  fontColor,
float  opacity 
)
inlinevirtual

Sets the font color of this Element and the opacity of the text.

Parameters
fontColor a iText.Kernel.Colors.Color for the text in this Element.
opacity an opacity for the text in this Element; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent.
Returns
this Element.

◆ SetFontFamily() [1/2]

virtual T iText.Layout.ElementPropertyContainer< T >.SetFontFamily ( IList< String >  fontFamilyNames )
inlinevirtual

Sets the preferable font families for this Element.

Sets the preferable font families for this Element. Note that iText.Layout.Font.FontProvider shall be set as well. See RootElement.SetFontProvider(iText.Layout.Font.FontProvider)

This property overrides the value set by ElementPropertyContainer.SetFont(iText.Kernel.Font.PdfFont) . Font is set either via exact iText.Kernel.Font.PdfFont instance or via font-family name that should correspond to the font in iText.Layout.Font.FontProvider , but not both.

All System.String that are passed as argument are directly handled as a collection of font family names, without any pre-processing. Every font family name is treated as a preferable font-family to be used inside the element. The fontFamilyNames argument is interpreted as as an ordered list, where every next font-family should be used if font for the previous one was not found or doesn't contain required glyphs.

See also
iText.IO.Font.Constants.StandardFontFamilies
Parameters
fontFamilyNames defines an ordered list of preferable font families for this Element.
Returns
this Element.

◆ SetFontFamily() [2/2]

virtual T iText.Layout.ElementPropertyContainer< T >.SetFontFamily ( params String[]  fontFamilyNames )
inlinevirtual

Sets the preferable font families for this Element.

Sets the preferable font families for this Element. Note that iText.Layout.Font.FontProvider shall be set as well. See RootElement.SetFontProvider(iText.Layout.Font.FontProvider)

This property overrides the value set by ElementPropertyContainer.SetFont(iText.Kernel.Font.PdfFont) . Font is set either via exact iText.Kernel.Font.PdfFont instance or via font-family name that should correspond to the font in iText.Layout.Font.FontProvider , but not both.

All System.String that are passed as argument are directly handled as a collection of font family names, without any pre-processing. Every font family name is treated as a preferable font-family to be used inside the element. The fontFamilyNames argument is interpreted as as an ordered list, where every next font-family should be used if font for the previous one was not found or doesn't contain required glyphs.

See also
iText.IO.Font.Constants.StandardFontFamilies
Parameters
fontFamilyNames defines an ordered list of preferable font families for this Element.
Returns
this Element.

◆ SetFontKerning()

virtual T iText.Layout.ElementPropertyContainer< T >.SetFontKerning ( FontKerning  fontKerning )
inlinevirtual

Enable or disable kerning.

Enable or disable kerning. Some fonts may specify kern pairs, i.e. pair of glyphs, between which the amount of horizontal space is adjusted. This adjustment is typically negative, e.g. in "AV" pair the glyphs will typically be moved closer to each other.

Parameters
fontKerning an enum value as a boolean wrapper specifying whether or not to apply kerning
Returns
this Element.

◆ SetFontScript()

virtual T iText.Layout.ElementPropertyContainer< T >.SetFontScript ( UnicodeScript script )
inlinevirtual

Sets the writing system for this text element.

Parameters
script a new script type
Returns
this Element.

◆ SetFontSize()

virtual T iText.Layout.ElementPropertyContainer< T >.SetFontSize ( float  fontSize )
inlinevirtual

Sets the font size of this Element, measured in points.

Parameters
fontSize a floating point value
Returns
this Element.

◆ SetHorizontalAlignment()

virtual T iText.Layout.ElementPropertyContainer< T >.SetHorizontalAlignment ( HorizontalAlignment horizontalAlignment )
inlinevirtual

Sets the horizontal alignment of this Element.

Parameters
horizontalAlignment an enum value of type iText.Layout.Properties.HorizontalAlignment?
Returns
this Element.

◆ SetHyphenation()

virtual T iText.Layout.ElementPropertyContainer< T >.SetHyphenation ( HyphenationConfig  hyphenationConfig )
inlinevirtual

Sets a custom hyphenation configuration which will hyphenate words automatically accordingly to the language and country.

Parameters
hyphenationConfig The hyphenation configuration
Returns
this element

◆ SetItalic()

virtual T iText.Layout.ElementPropertyContainer< T >.SetItalic ( )
inlinevirtual

Switch on the simulation of italic style for a font.

Switch on the simulation of italic style for a font. Be aware that using correct italic (oblique) font is highly preferred over this option.

Returns
this element

◆ SetLineThrough()

virtual T iText.Layout.ElementPropertyContainer< T >.SetLineThrough ( )
inlinevirtual

Sets default line-through attributes for text.

Sets default line-through attributes for text. See ElementPropertyContainer.SetUnderline(iText.Kernel.Colors.Color, float, float, float, float, int) for more fine tuning.

Returns
this element

◆ SetOpacity()

virtual T iText.Layout.ElementPropertyContainer< T >.SetOpacity ( float?  opacity )
inlinevirtual

Sets an opacity of the given element.

Sets an opacity of the given element. It will affect element content, borders and background. Note, that it will also affect all element children, as they are the content of the given element.

Parameters
opacity a float between 0 and 1, where 1 stands for fully opaque element and 0 - for fully transparent
Returns
this Element.

◆ SetProperty()

virtual void iText.Layout.ElementPropertyContainer< 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

Implements iText.Layout.IPropertyContainer.

Reimplemented in iText.Layout.RootElement< T >.

◆ SetRelativePosition()

virtual T iText.Layout.ElementPropertyContainer< T >.SetRelativePosition ( float  left,
float  top,
float  right,
float  bottom 
)
inlinevirtual

Sets values for a relative repositioning of the Element.

Sets values for a relative repositioning of the Element. Also has as a side effect that the Element's iText.Layout.Properties.Property.POSITION is changed to relative. The default implementation in iText.Layout.Renderer.AbstractRenderer treats left and top as the most important values. Only if left == 0 will right be used for the calculation; ditto for top vs. bottom.

Parameters
left movement to the left
top movement upwards on the page
right movement to the right
bottom movement downwards on the page
Returns
this Element.
See also
iText.Layout.Layout.LayoutPosition.RELATIVE

◆ SetSplitCharacters()

virtual T iText.Layout.ElementPropertyContainer< T >.SetSplitCharacters ( ISplitCharacters  splitCharacters )
inlinevirtual

Sets a rule for splitting strings when they don't fit into one line.

Sets a rule for splitting strings when they don't fit into one line. The default implementation is iText.Layout.Splitting.DefaultSplitCharacters

Parameters
splitCharacters an implementation of iText.Layout.Splitting.ISplitCharacters
Returns
this Element.

◆ SetStrokeColor()

virtual T iText.Layout.ElementPropertyContainer< T >.SetStrokeColor ( Color  strokeColor )
inlinevirtual

Sets the stroke color for the current element.

Sets the stroke color for the current element. The stroke color is the color of the outlines or edges of a shape.

Parameters
strokeColor a new stroke color
Returns
this Element.

◆ SetStrokeWidth()

virtual T iText.Layout.ElementPropertyContainer< T >.SetStrokeWidth ( float  strokeWidth )
inlinevirtual

Sets the stroke width for the current element.

Sets the stroke width for the current element. The stroke width is the width of the outlines or edges of a shape.

Parameters
strokeWidth a new stroke width
Returns
this Element.

◆ SetTextAlignment()

virtual T iText.Layout.ElementPropertyContainer< T >.SetTextAlignment ( TextAlignment alignment )
inlinevirtual

Sets the text alignment of this Element.

Parameters
alignment an enum value of type iText.Layout.Properties.TextAlignment?
Returns
this Element.

◆ SetTextRenderingMode()

virtual T iText.Layout.ElementPropertyContainer< T >.SetTextRenderingMode ( int  textRenderingMode )
inlinevirtual

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.

Parameters
textRenderingMode an int value
Returns
this Element.
See also
iText.Kernel.Pdf.Canvas.PdfCanvasConstants.TextRenderingMode

◆ SetUnderline() [1/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetUnderline ( )
inlinevirtual

Sets default underline attributes for text.

Sets default underline attributes for text. See other overloads for more fine tuning.

Returns
this element

◆ SetUnderline() [2/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetUnderline ( Color  color,
float  opacity,
float  thickness,
float  thicknessMul,
float  yPosition,
float  yPositionMul,
int  lineCapStyle 
)
inlinevirtual

Sets an horizontal line that can be an underline or a strikethrough.

Sets an horizontal line that can be an underline or a strikethrough. Actually, the line can be anywhere vertically due to position parameter. Multiple call to this method will produce multiple lines.

The thickness of the line will be thickness + thicknessMul * fontSize. The position of the line will be baseLine + yPosition + yPositionMul * fontSize.

Parameters
color the color of the line or null to follow the text color
opacity the opacity of the line; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
thickness the absolute thickness of the line
thicknessMul the thickness multiplication factor with the font size
yPosition the absolute y position relative to the baseline
yPositionMul the position multiplication factor with the font size
lineCapStyle the end line cap style. Allowed values are enumerated in iText.Kernel.Pdf.Canvas.PdfCanvasConstants.LineCapStyle
Returns
this element

◆ SetUnderline() [3/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetUnderline ( Color  color,
float  thickness,
float  thicknessMul,
float  yPosition,
float  yPositionMul,
int  lineCapStyle 
)
inlinevirtual

Sets an horizontal line that can be an underline or a strikethrough.

Sets an horizontal line that can be an underline or a strikethrough. Actually, the line can be anywhere vertically due to position parameter. Multiple call to this method will produce multiple lines.

The thickness of the line will be thickness + thicknessMul * fontSize. The position of the line will be baseLine + yPosition + yPositionMul * fontSize.

Parameters
color the color of the line or null to follow the text color
thickness the absolute thickness of the line
thicknessMul the thickness multiplication factor with the font size
yPosition the absolute y position relative to the baseline
yPositionMul the position multiplication factor with the font size
lineCapStyle the end line cap style. Allowed values are enumerated in iText.Kernel.Pdf.Canvas.PdfCanvasConstants.LineCapStyle
Returns
this element

◆ SetUnderline() [4/4]

virtual T iText.Layout.ElementPropertyContainer< T >.SetUnderline ( float  thickness,
float  yPosition 
)
inlinevirtual

Sets an horizontal line that can be an underline or a strikethrough.

Sets an horizontal line that can be an underline or a strikethrough. Actually, the line can be anywhere vertically and has always the text width. Multiple call to this method will produce multiple lines.

Parameters
thickness the absolute thickness of the line
yPosition the absolute y position relative to the baseline
Returns
this element

◆ SetWordSpacing()

virtual T iText.Layout.ElementPropertyContainer< T >.SetWordSpacing ( float  wordSpacing )
inlinevirtual

Defines a custom spacing distance between words of a textual element.

Defines a custom spacing distance between words of a textual element. This value works exactly like the character spacing, but only kicks in at word boundaries.

Parameters
wordSpacing a floating point value
Returns
this Element.