Package com.itextpdf.layout.element
Class Div
- java.lang.Object
-
- All Implemented Interfaces:
IAbstractElement
,IBlockElement
,IElement
,IPropertyContainer
,IAccessibleElement
- Direct Known Subclasses:
FlexContainer
,GridContainer
,ListItem
,MulticolContainer
public class Div extends BlockElement<Div>
ADiv
is a container object that defines a section in a document, which will have some shared layout properties. Like allBlockElement
types, it will try to take up as much horizontal space as possible.The concept is very similar to that of the div tag in HTML.
-
-
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
-
-
Constructor Summary
Constructors Constructor Description Div()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Div
add(AreaBreak areaBreak)
Adds an area break to the div's contents.Div
add(IBlockElement element)
Adds any block element to the div's contents.Div
add(Image element)
Adds an image to the div's contents.AccessibilityProperties
getAccessibilityProperties()
Gets theaccessibility properties
.protected IRenderer
makeNewRenderer()
Creates new renderer instance.Div
setFillAvailableArea(boolean fillArea)
Defines whether theDiv
should occupy all the space left in the available area in case it is the last element in this area.Div
setFillAvailableAreaOnSplit(boolean fillAreaOnSplit)
Defines whether theDiv
should occupy all the space left in the available area in case the area has been split and it is the last element in the split part of this area.-
Methods inherited from class com.itextpdf.layout.element.BlockElement
getDefaultProperty, 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, 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 Div add(IBlockElement element)
Adds any block element to the div's contents.- Parameters:
element
- aBlockElement
- Returns:
- this Element
-
add
public Div add(Image element)
Adds an image to the div's contents.- Parameters:
element
- anImage
- Returns:
- this Element
-
add
public Div add(AreaBreak areaBreak)
Adds an area break to the div's contents.- Parameters:
areaBreak
- anAreaBreak
- Returns:
- this Element
-
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.
-
setFillAvailableArea
public Div setFillAvailableArea(boolean fillArea)
Defines whether theDiv
should occupy all the space left in the available area in case it is the last element in this area.- Parameters:
fillArea
- defines whether the available area should be filled- Returns:
- this
Div
-
setFillAvailableAreaOnSplit
public Div setFillAvailableAreaOnSplit(boolean fillAreaOnSplit)
Defines whether theDiv
should occupy all the space left in the available area in case the area has been split and it is the last element in the split part of this area.- Parameters:
fillAreaOnSplit
- defines whether the available area should be filled- Returns:
- this
Div
-
makeNewRenderer
protected IRenderer makeNewRenderer()
Description copied from class:AbstractElement
Creates new renderer instance.- Specified by:
makeNewRenderer
in classAbstractElement<Div>
- Returns:
- new
IRenderer
-
-