iText 9.8.1 API
iText.Layout.Element.AbstractParagraph< T > Class Template Reference

An abstract class that represents a paragraph of text in a document. More...

Inheritance diagram for iText.Layout.Element.AbstractParagraph< T >:
iText.Layout.Element.BlockElement< T > iText.Layout.Element.AbstractElement< T > iText.Layout.Tagging.IAccessibleElement iText.Layout.Element.IBlockElement iText.Layout.ElementPropertyContainer< T > iText.Layout.Element.IAbstractElement iText.Layout.Element.IAbstractElement iText.Commons.Actions.Sequence.AbstractIdentifiableElement iText.Layout.IPropertyContainer iText.Layout.Element.IElement iText.Layout.Element.IElement iText.Layout.IPropertyContainer iText.Layout.IPropertyContainer

Public Member Functions

virtual T  Add (String text)
  Adds a piece of text to this AbstractParagraph. More...
 
virtual T  Add (ILeafElement element)
  Adds a ILeafElement element to this AbstractParagraph. More...
 
virtual T  Add (Paragraph element)
  Adds a Paragraph element. More...
 
virtual T  Add (VerticalParagraph element)
  Adds a VerticalParagraph element. More...
 
virtual T  AddAll< T2 > (IList< T2 > elements)
  Adds a System.Collections.IList of layout elements to this AbstractParagraph. More...
 
virtual T  SetFirstLineIndent (float indent)
  Sets the indent value for the first line of the AbstractParagraph. More...
 
override T1  GetDefaultProperty< T1 > (int property)
  Gets the default property from this entity. More...
 
virtual T  SetOrphansControl (ParagraphOrphansControl orphansControl)
  Sets orphans restriction on a AbstractParagraph. More...
 
virtual T  SetWidowsControl (ParagraphWidowsControl widowsControl)
  Sets widows restriction on a AbstractParagraph. More...
 
override AccessibilityProperties  GetAccessibilityProperties ()
  Gets the accessibility properties. More...
 
- Public Member Functions inherited from iText.Layout.Element.BlockElement< T >
override T1  GetDefaultProperty< T1 > (int property)
  Gets the default property from this entity. More...
 
virtual UnitValue  GetMarginLeft ()
  Gets the current left margin width of the element. More...
 
virtual T  SetMarginLeft (float value)
  Sets the left margin width of the element. More...
 
virtual UnitValue  GetMarginRight ()
  Gets the current right margin width of the element. More...
 
virtual T  SetMarginRight (float value)
  Sets the right margin width of the element. More...
 
virtual UnitValue  GetMarginTop ()
  Gets the current top margin width of the element. More...
 
virtual T  SetMarginTop (float value)
  Sets the top margin width of the element. More...
 
virtual UnitValue  GetMarginBottom ()
  Gets the current bottom margin width of the element. More...
 
virtual T  SetMarginBottom (float value)
  Sets the bottom margin width of the element. More...
 
virtual T  SetMargin (float commonMargin)
  Sets all margins around the element to the same width. More...
 
virtual T  SetMargins (float marginTop, float marginRight, float marginBottom, float marginLeft)
  Sets the margins around the element to a series of new widths. More...
 
virtual UnitValue  GetPaddingLeft ()
  Gets the current left padding width of the element. More...
 
virtual T  SetPaddingLeft (float value)
  Sets the left padding width of the element. More...
 
virtual UnitValue  GetPaddingRight ()
  Gets the current right padding width of the element. More...
 
virtual T  SetPaddingRight (float value)
  Sets the right padding width of the element. More...
 
virtual UnitValue  GetPaddingTop ()
  Gets the current top padding width of the element. More...
 
virtual T  SetPaddingTop (float value)
  Sets the top padding width of the element. More...
 
virtual UnitValue  GetPaddingBottom ()
  Gets the current bottom padding width of the element. More...
 
virtual T  SetPaddingBottom (float value)
  Sets the bottom padding width of the element. More...
 
virtual T  SetPadding (float commonPadding)
  Sets all paddings around the element to the same width. More...
 
virtual T  SetPaddings (float paddingTop, float paddingRight, float paddingBottom, float paddingLeft)
  Sets the paddings around the element to a series of new widths. More...
 
virtual T  SetVerticalAlignment (VerticalAlignment? verticalAlignment)
  Sets the vertical alignment of the element. More...
 
virtual T  SetSpacingRatio (float ratio)
  Sets a ratio which determines in which proportion will word spacing and character spacing be applied when horizontal alignment is justified. More...
 
virtual ? bool  IsKeepTogether ()
  Returns whether the BlockElement should be kept together as much as possible. More...
 
virtual T  SetKeepTogether (bool keepTogether)
  Sets whether the BlockElement should be kept together as much as possible. More...
 
virtual ? bool  IsKeepWithNext ()
  Returns whether the end of this BlockElement and the start of the next sibling of this element should be placed in the same area. More...
 
virtual T  SetKeepWithNext (bool keepWithNext)
  Sets whether the end of this BlockElement and the start of the next sibling of this element should be placed in the same area. More...
 
virtual T  SetRotationAngle (float angleInRadians)
  Sets the rotation angle for this element. More...
 
virtual T  SetRotationAngle (double angleInRadians)
  Sets the rotation angle for this element. More...
 
virtual T  SetTransform (Transform transform)
  Sets a transformation to be applied to this block element during rendering. More...
 
virtual T  SetWidth (float width)
  Sets the width property of a block element, measured in points. More...
 
virtual T  SetWidth (UnitValue width)
  Sets the width property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual UnitValue  GetWidth ()
  Gets the width property of a block element. More...
 
virtual T  SetHeight (UnitValue height)
  Sets the height property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual T  SetHeight (float height)
  Sets the height property a block element as a point-value. More...
 
virtual UnitValue  GetHeight ()
  Gets the height property of a block element. More...
 
virtual T  SetMaxHeight (float maxHeight)
  Sets the max-height of a block element as point-unit value. More...
 
virtual T  SetMaxHeight (UnitValue maxHeight)
  Sets the max-height property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual T  SetMinHeight (UnitValue minHeight)
  Sets the min-height property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual T  SetMinHeight (float minHeight)
  Sets the min-height of a block element as point-unit value. More...
 
virtual T  SetMaxWidth (UnitValue maxWidth)
  Sets the max-width property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual T  SetMaxWidth (float maxWidth)
  Sets the max-width of a block element as point-unit value. More...
 
virtual T  SetMinWidth (UnitValue minWidth)
  Sets the min-width property of a block element with a iText.Layout.Properties.UnitValue. More...
 
virtual T  SetMinWidth (float minWidth)
  Sets the min-width of a block element as point-unit value. More...
 
virtual T  SetNeutralRole ()
  Give this element a neutral role. More...
 
- Public Member Functions inherited from iText.Layout.Element.AbstractElement< T >
virtual IRenderer  GetRenderer ()
  Gets a renderer for this element. More...
 
virtual void  SetNextRenderer (IRenderer renderer)
  Overrides the iText.Layout.Renderer.IRenderer instance which will be returned by the next call to the GetRenderer(). More...
 
virtual IRenderer  CreateRendererSubTree ()
  Creates a renderer subtree with root in the current element. More...
 
override bool  HasProperty (int property)
  Checks if this entity has the specified property. More...
 
override T1  GetProperty< T1 > (int property)
  Gets the property from this entity. More...
 
virtual T  AddStyle (Style style)
  Add a new style to this element. More...
 
virtual T  AddStyleIfAbsent (Style style)
  Adds a new style that contains only those properties from the given style that are not already defined on this element (either directly or via previously added styles). More...
 
virtual ICollection< Style >  GetStyles ()
  Gets the styles added to this element. More...
 
virtual IList< IElement >  GetChildren ()
  Gets the child elements of this elements More...
 
virtual bool  IsEmpty ()
  Returns true if this list contains no elements. More...
 
virtual T  SetAction (PdfAction action)
  Sets an action on this Element. More...
 
virtual T  SetPageNumber (int pageNumber)
  Explicitly sets the page number this element should be put on. More...
 
- Public Member Functions inherited from iText.Layout.ElementPropertyContainer< T >
virtual void  SetProperty (int property, Object value)
  Sets a property for this entity. 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  GetOwnProperty< T1 > (int property)
  Gets own property from this entity. More...
 
virtual IDictionary< int, Object >  GetOwnProperties ()
  Gets a copy of this container's properties. 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 TransparentColor  GetTransparentStrokeColor ()
  Gets the stroke color for the current element. More...
 
virtual T  SetStrokeColor (Color strokeColor)
  Sets the stroke color for the current element. More...
 
virtual T  SetStrokeColor (Color strokeColor, float opacity)
  Sets the stroke color for the current element. More...
 
virtual T  SetStrokeColor (TransparentColor transparentColor)
  Sets the stroke color for the current element. More...
 
virtual T  SetDashPattern (float[] dashArray, float dashPhase)
  Sets the stroke dash pattern for the current text. 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 ? int  GetLineCapStyle ()
  Gets the line cap style for the current element. More...
 
virtual T  SetLineCapStyle (int lineCapStyle)
  Sets the line cap style for the current element. More...
 
virtual ? int  GetLineJoinStyle ()
  Gets the line join style for the current element. More...
 
virtual T  SetLineJoinStyle (int lineJoinStyle)
  Sets the line join style for the current element. More...
 
virtual ? float  GetMiterLimit ()
  Gets the miter limit for the current element. More...
 
virtual T  SetMiterLimit (float miterLimit)
  Sets the miter limit for the current element. More...
 
virtual T  SimulateBold ()
  Simulates bold style for a font. More...
 
virtual T  SimulateItalic ()
  Simulates 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 horizontal line that can be an underline or a strikethrough. More...
 
virtual T  SetUnderline (Underline underline)
  Sets horizontal line that can be an underline, overline 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 Functions

  AbstractParagraph ()
  Creates a new instance of AbstractParagraph. More...
 
virtual void  AddTabStopsAsProperty (IList< TabStop > newTabStops)
  Adds a list of TabStop objects to the paragraph's properties. More...
 
- Package Functions inherited from iText.Layout.Element.BlockElement< T >
  BlockElement ()
  Creates a BlockElement. More...
 
- Package Functions inherited from iText.Layout.Element.AbstractElement< T >
abstract IRenderer  MakeNewRenderer ()
  Creates a new renderer instance. More...
 

Package Attributes

DefaultAccessibilityProperties  tagProperties
 
- Package Attributes inherited from iText.Layout.Element.AbstractElement< T >
IRenderer  nextRenderer
 
IList< IElement >  childElements = new List<IElement>()
 
ICollection< Style >  styles
 
- Package Attributes inherited from iText.Layout.ElementPropertyContainer< T >
IDictionary< int, Object >  properties = new Dictionary()
 

Detailed Description

An abstract class that represents a paragraph of text in a document.

An abstract class that represents a paragraph of text in a document. It provides methods for adding text and other elements to the paragraph, as well as managing properties such as leading, indentation, and margins.

Template Parameters
T the type of the concrete subclass extending this abstract class
Type Constraints
T  : iText.Layout.Element.AbstractParagraph  

Constructor & Destructor Documentation

◆ AbstractParagraph()

Creates a new instance of AbstractParagraph.

Creates a new instance of AbstractParagraph . This constructor is protected to allow subclassing.

Member Function Documentation

◆ Add() [1/4]

virtual T iText.Layout.Element.AbstractParagraph< T >.Add ( ILeafElement  element )
inlinevirtual

Adds a ILeafElement element to this AbstractParagraph.

Parameters
element the content to be added, any ILeafElement
Returns
this Element

Reimplemented in iText.Layout.Element.Paragraph.

◆ Add() [2/4]

virtual T iText.Layout.Element.AbstractParagraph< T >.Add ( Paragraph  element )
inlinevirtual

Adds a Paragraph element.

Parameters
element the content to be added, any Paragraph
Returns
this Element

◆ Add() [3/4]

virtual T iText.Layout.Element.AbstractParagraph< T >.Add ( String  text )
inlinevirtual

Adds a piece of text to this AbstractParagraph.

Parameters
text the content to be added, as a System.String
Returns
this Element

Reimplemented in iText.Layout.Element.Paragraph.

◆ Add() [4/4]

virtual T iText.Layout.Element.AbstractParagraph< T >.Add ( VerticalParagraph  element )
inlinevirtual

Adds a VerticalParagraph element.

Parameters
element the content to be added, any VerticalParagraph
Returns
this Element

◆ AddAll< T2 >()

virtual T iText.Layout.Element.AbstractParagraph< T >.AddAll< T2 > ( IList< T2 >  elements )
inlinevirtual

Adds a System.Collections.IList of layout elements to this AbstractParagraph.

Parameters
elements the content to be added
Template Parameters
T2 any ILeafElement
Returns
this Element

Reimplemented in iText.Layout.Element.Paragraph.

Type Constraints
T2  : ILeafElement  

◆ AddTabStopsAsProperty()

virtual void iText.Layout.Element.AbstractParagraph< T >.AddTabStopsAsProperty ( IList< TabStop >  newTabStops )
inlinepackagevirtual

Adds a list of TabStop objects to the paragraph's properties.

Parameters
newTabStops the list of TabStop objects to be added

◆ GetAccessibilityProperties()

override AccessibilityProperties iText.Layout.Element.AbstractParagraph< T >.GetAccessibilityProperties ( )
inlinevirtual

◆ GetDefaultProperty< T1 >()

override T1 iText.Layout.Element.AbstractParagraph< 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 >.

◆ SetFirstLineIndent()

virtual T iText.Layout.Element.AbstractParagraph< T >.SetFirstLineIndent ( float  indent )
inlinevirtual

Sets the indent value for the first line of the AbstractParagraph.

Parameters
indent the indent value that must be applied to the first line of the AbstractParagraph , as a float
Returns
this Element

Reimplemented in iText.Layout.Element.Paragraph.

◆ SetOrphansControl()

virtual T iText.Layout.Element.AbstractParagraph< T >.SetOrphansControl ( ParagraphOrphansControl  orphansControl )
inlinevirtual

Sets orphans restriction on a AbstractParagraph.

Parameters
orphansControl an instance of iText.Layout.Properties.ParagraphOrphansControl
Returns
this Element

◆ SetWidowsControl()

virtual T iText.Layout.Element.AbstractParagraph< T >.SetWidowsControl ( ParagraphWidowsControl  widowsControl )
inlinevirtual

Sets widows restriction on a AbstractParagraph.

Parameters
widowsControl an instance of iText.Layout.Properties.ParagraphWidowsControl
Returns
this Element