Package com.itextpdf.layout.element
Class AbstractParagraph>
java.lang.Object
com.itextpdf.commons.actions.sequence.AbstractIdentifiableElement
com.itextpdf.layout.ElementPropertyContainer
com.itextpdf.layout.element.AbstractElement
com.itextpdf.layout.element.BlockElement
com.itextpdf.layout.element.AbstractParagraph
- Type Parameters:
-
T- the type of the concrete subclass extending this abstract class
- All Implemented Interfaces:
-
IAbstractElement,IBlockElement,IElement,IPropertyContainer,IAccessibleElement
- Direct Known Subclasses:
-
Paragraph,VerticalParagraph
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.
-
Field Summary
FieldsFields inherited from class com.itextpdf.layout.element.AbstractElement
childElements, nextRenderer, stylesFields inherited from class com.itextpdf.layout.ElementPropertyContainer
properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(ILeafElement element) Adds aILeafElementelement to thisAbstractParagraph.Adds aParagraphelement.add(VerticalParagraph element) Adds aVerticalParagraphelement.Adds a piece of text to thisAbstractParagraph.ILeafElement>
TAdds aListof layout elements to thisAbstractParagraph.protected voidaddTabStopsAsProperty(List<TabStop> newTabStops) Adds a list ofTabStopobjects to the paragraph's properties.Gets theaccessibility properties.T1 getDefaultProperty(int property) Gets the default property from this entity.setFirstLineIndent(float indent) Sets the indent value for the first line of theAbstractParagraph.setOrphansControl(ParagraphOrphansControl orphansControl) Sets orphans restriction on aAbstractParagraph.setWidowsControl(ParagraphWidowsControl widowsControl) Sets widows restriction on aAbstractParagraph.Methods inherited from class com.itextpdf.layout.element.BlockElement
getHeight, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getWidth, isKeepTogether, isKeepWithNext, setHeight, setHeight, setKeepTogether, setKeepWithNext, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMargins, setMarginTop, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setNeutralRole, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddings, setPaddingTop, setRotationAngle, setRotationAngle, setSpacingRatio, setTransform, setVerticalAlignment, setWidth, setWidthMethods inherited from class com.itextpdf.layout.element.AbstractElement
addStyle, addStyleIfAbsent, createRendererSubTree, getChildren, getProperty, getRenderer, getStyles, hasProperty, isEmpty, makeNewRenderer, setAction, setNextRenderer, setPageNumberMethods inherited from class com.itextpdf.layout.ElementPropertyContainer
deleteOwnProperty, getLineCapStyle, getLineJoinStyle, getMiterLimit, getOwnProperties, getOwnProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, getTransparentStrokeColor, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBaseDirection, setBorder, setBorderBottom, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBorderTopLeftRadius, setBorderTopRightRadius, setCharacterSpacing, setDashPattern, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFontColor, setFontColor, setFontColor, setFontFamily, setFontFamily, setFontKerning, setFontScript, setFontSize, setHorizontalAlignment, setHyphenation, setLineCapStyle, setLineJoinStyle, setLineThrough, setMiterLimit, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeColor, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacing, simulateBold, simulateItalicMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.itextpdf.layout.element.IAbstractElement
getChildrenMethods inherited from interface com.itextpdf.layout.element.IElement
createRendererSubTree, getRenderer, setNextRendererMethods inherited from interface com.itextpdf.layout.IPropertyContainer
deleteOwnProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setProperty
-
Field Details
-
tagProperties
-
-
Constructor Details
-
AbstractParagraph
protected AbstractParagraph()Creates a new instance ofAbstractParagraph. This constructor is protected to allow subclassing.
-
-
Method Details
-
add
Adds a piece of text to thisAbstractParagraph.- Parameters:
-
text- the content to be added, as aString - Returns:
- this Element
-
add
Adds aILeafElementelement to thisAbstractParagraph.- Parameters:
-
element- the content to be added, anyILeafElement - Returns:
- this Element
-
add
Adds aParagraphelement.- Parameters:
-
element- the content to be added, anyParagraph - Returns:
- this Element
-
add
Adds aVerticalParagraphelement.- Parameters:
-
element- the content to be added, anyVerticalParagraph - Returns:
- this Element
-
addAll
Adds aListof layout elements to thisAbstractParagraph.- Type Parameters:
-
T2- anyILeafElement - Parameters:
-
elements- the content to be added - Returns:
- this Element
-
setFirstLineIndent
Sets the indent value for the first line of theAbstractParagraph.- Parameters:
-
indent- the indent value that must be applied to the first line of theAbstractParagraph, as afloat - Returns:
- this Element
-
getDefaultProperty
publicT1 getDefaultProperty (int property) Description copied from interface:IPropertyContainerGets the default property from this entity.- Specified by:
-
getDefaultPropertyin interfaceIPropertyContainer - Overrides:
-
getDefaultPropertyin classBlockElement<T extends AbstractParagraph<T>> - Type 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,
nullwill be returned
-
setOrphansControl
Sets orphans restriction on aAbstractParagraph.- Parameters:
-
orphansControl- an instance ofParagraphOrphansControl - Returns:
- this Element
-
setWidowsControl
Sets widows restriction on aAbstractParagraph.- Parameters:
-
widowsControl- an instance ofParagraphWidowsControl - Returns:
- this Element
-
getAccessibilityProperties
Gets theaccessibility properties. See alsoIAccessibleElement.- Returns:
- an interface that allows to specify properties of a tagged element in Tagged PDF.
-
addTabStopsAsProperty
Adds a list ofTabStopobjects to the paragraph's properties.- Parameters:
-
newTabStops- the list ofTabStopobjects to be added
-