Package com.itextpdf.layout.element
Class Paragraph
-
- All Implemented Interfaces:
-
IAbstractElement
,IBlockElement
,IElement
,IPropertyContainer
,IAccessibleElement
public class Paragraph extends BlockElement<Paragraph>
A layout element that represents a self-contained block of textual and graphical information. It is aBlockElement
which essentially acts as a container forleaf elements
.
-
-
Field Summary
Fields Modifier and Type Field Description protected DefaultAccessibilityProperties
tagProperties
-
Fields inherited from class com.itextpdf.layout.element.AbstractElement
childElements, nextRenderer, styles
-
Fields inherited from class com.itextpdf.layout.ElementPropertyContainer
properties
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Paragraph
add(IBlockElement element)
Paragraph
add(ILeafElement element)
Paragraph
add(String text)
Adds a piece of text to thisParagraph
.<T2 extends ILeafElement>
ParagraphaddAll(List<T2> elements)
Paragraph
addTabStops(TabStop... tabStops)
Adds an unspecified amount of tabstop elements as properties to thisParagraph
.Paragraph
addTabStops(List<TabStop> tabStops)
AccessibilityProperties
getAccessibilityProperties()
Gets theaccessibility properties
.<T1> T1
getDefaultProperty(int property)
Gets the default property from this entity.protected IRenderer
makeNewRenderer()
Creates new renderer instance.Paragraph
removeTabStop(float tabStopPosition)
Removes a tabstop position from the Paragraph, if it is present in theProperty.TAB_STOPS
property.Paragraph
setFirstLineIndent(float indent)
Sets the indent value for the first line of theParagraph
.Paragraph
setFixedLeading(float leading)
Sets the leading value, using theLeading.FIXED
strategy.Paragraph
setMultipliedLeading(float leading)
Sets the leading value, using theLeading.MULTIPLIED
strategy.Paragraph
setOrphansControl(ParagraphOrphansControl orphansControl)
Sets orphans restriction on aParagraph
.Paragraph
setWidowsControl(ParagraphWidowsControl widowsControl)
Sets widows restriction on aParagraph
.-
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, setVerticalAlignment, setWidth, setWidth
-
Methods inherited from class com.itextpdf.layout.element.AbstractElement
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, setAction, setNextRenderer, setPageNumber
-
Methods inherited from class com.itextpdf.layout.ElementPropertyContainer
deleteOwnProperty, getOwnProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, setBaseDirection, setBold, setBorder, setBorderBottom, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBorderTopLeftRadius, setBorderTopRightRadius, setCharacterSpacing, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFontColor, setFontColor, setFontFamily, setFontFamily, setFontKerning, setFontScript, setFontSize, setHorizontalAlignment, setHyphenation, setItalic, setLineThrough, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacing
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.itextpdf.layout.element.IAbstractElement
getChildren
-
Methods inherited from interface com.itextpdf.layout.element.IElement
createRendererSubTree, getRenderer, setNextRenderer
-
Methods inherited from interface com.itextpdf.layout.IPropertyContainer
deleteOwnProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setProperty
-
-
-
-
Field Detail
-
tagProperties
protected DefaultAccessibilityProperties tagProperties
-
-
Method Detail
-
add
public Paragraph add(ILeafElement element)
- Parameters:
-
element
- the content to be added, anyILeafElement
- Returns:
-
this
Paragraph
-
add
public Paragraph add(IBlockElement element)
- Parameters:
-
element
- the content to be added, anyIBlockElement
- Returns:
-
this
Paragraph
-
addAll
public <T2 extends ILeafElement> Paragraph addAll(List<T2> elements)
- Type Parameters:
-
T2
- anyILeafElement
- Parameters:
-
elements
- the content to be added - Returns:
-
this
Paragraph
-
addTabStops
public Paragraph addTabStops(TabStop... tabStops)
Adds an unspecified amount of tabstop elements as properties to thisParagraph
.- Parameters:
-
tabStops
- thetabstop(s)
to be added as properties - Returns:
-
this
Paragraph
- See Also:
-
TabStop
-
removeTabStop
public Paragraph removeTabStop(float tabStopPosition)
Removes a tabstop position from the Paragraph, if it is present in theProperty.TAB_STOPS
property.
-
getDefaultProperty
public <T1> T1 getDefaultProperty(int property)
Description copied from interface:IPropertyContainer
Gets the default property from this entity.- Specified by:
-
getDefaultProperty
in interfaceIPropertyContainer
- Overrides:
-
getDefaultProperty
in classBlockElement<Paragraph>
- 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,
null
will be returned
-
setFirstLineIndent
public Paragraph setFirstLineIndent(float indent)
Sets the indent value for the first line of theParagraph
.- Parameters:
-
indent
- the indent value that must be applied to the first line of the Paragraph, as afloat
- Returns:
- this Paragraph
-
setOrphansControl
public Paragraph setOrphansControl(ParagraphOrphansControl orphansControl)
Sets orphans restriction on aParagraph
.- Parameters:
-
orphansControl
- an instance ofParagraphOrphansControl
. - Returns:
-
this
Paragraph
instance.
-
setWidowsControl
public Paragraph setWidowsControl(ParagraphWidowsControl widowsControl)
Sets widows restriction on aParagraph
.- Parameters:
-
widowsControl
- an instance ofParagraphWidowsControl
. - Returns:
-
this
Paragraph
instance.
-
setFixedLeading
public Paragraph setFixedLeading(float leading)
Sets the leading value, using theLeading.FIXED
strategy.- Parameters:
-
leading
- the new leading value - Returns:
- this Paragraph
- See Also:
-
Leading
-
setMultipliedLeading
public Paragraph setMultipliedLeading(float leading)
Sets the leading value, using theLeading.MULTIPLIED
strategy.- Parameters:
-
leading
- the new leading value - Returns:
- this Paragraph
- See Also:
-
Leading
-
getAccessibilityProperties
public AccessibilityProperties getAccessibilityProperties()
Description copied from interface:IAccessibleElement
Gets theaccessibility properties
. See alsoIAccessibleElement
.- Returns:
- an interface that allows to specify properties of a tagged element in Tagged PDF.
-
makeNewRenderer
protected IRenderer makeNewRenderer()
Description copied from class:AbstractElement
Creates new renderer instance.- Specified by:
-
makeNewRenderer
in classAbstractElement<Paragraph>
- Returns:
-
new
IRenderer
-
-