Package com.itextpdf.layout.renderer
Class DocumentRenderer
java.lang.Object
com.itextpdf.layout.renderer.AbstractRenderer
com.itextpdf.layout.renderer.RootRenderer
com.itextpdf.layout.renderer.DocumentRenderer
- All Implemented Interfaces:
-
IPropertyContainer
,IRenderer
- Direct Known Subclasses:
-
ColumnDocumentRenderer
-
Field Summary
Fields inherited from class com.itextpdf.layout.renderer.RootRenderer
currentArea, immediateFlush, waitingDrawingElements
Fields inherited from class com.itextpdf.layout.renderer.AbstractRenderer
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties
-
Constructor Summary
ConstructorDescriptionDocumentRenderer
(Document document) DocumentRenderer
(Document document, boolean immediateFlush) -
Method Summary
Modifier and TypeMethodDescriptionprotected PageSize
addNewPage
(PageSize customPageSize) Adds new page with defined page size to PDF document.protected PageSize
ensureDocumentHasNPages
(int n, PageSize customPageSize) Ensures that PDF document has n pages.protected void
flushSingleRenderer
(IRenderer resultRenderer) ForDocumentRenderer
, this has a meaning of the renderer that will be used for relayout.Gets the resultant occupied area after the last call to theIRenderer.layout(LayoutContext)
method.Get handler for target-counters.boolean
Indicates if relayout is required for targetCounterHandler.protected LayoutArea
updateCurrentArea
(LayoutResult overflowResult) Methods inherited from class com.itextpdf.layout.renderer.RootRenderer
addChild, close, flush, flushWaitingDrawingElements, getCurrentArea, layout, shrinkCurrentAreaAndProcessRenderer
Methods inherited from class com.itextpdf.layout.renderer.AbstractRenderer
addAllProperties, alignChildHorizontally, allowLastYLineRecursiveExtraction, applyAbsolutePosition, applyAction, applyBorderBox, applyBorderBox, applyDestination, applyDestinationsAndAnnotation, applyLinkAnnotation, applyMargins, applyMargins, applyPaddings, applyPaddings, applyRelativePositioningTranslation, beginElementOpacityApplying, beginTransformationIfApplied, calculateAbsolutePdfBBox, calculateBBox, calculateShiftToPositionBBoxOfPointsAt, clipBackgroundArea, clipBackgroundArea, clipBorderArea, createXObject, deleteOwnProperty, deleteProperty, draw, drawBackground, drawBorder, drawChildren, endElementOpacityApplying, endTransformationIfApplied, getBackgroundArea, getBorderAreaBBox, getBorderRadii, getBorders, getChildRenderers, getDefaultProperty, getFirstYLineRecursively, getInnerAreaBBox, getLastYLineRecursively, getMargins, getMinMaxWidth, getModelElement, getOccupiedAreaBBox, getOwnProperties, getOwnProperty, getPaddings, getParent, getProperty, getProperty, getPropertyAsBoolean, getPropertyAsColor, getPropertyAsFloat, getPropertyAsFloat, getPropertyAsFont, getPropertyAsInteger, getPropertyAsTransparentColor, getPropertyAsUnitValue, hasAbsoluteUnitValue, hasOwnOrModelProperty, hasOwnProperty, hasProperty, hasRelativeUnitValue, initElementAreas, isAbsolutePosition, isBorderBoxSizing, isFirstOnRootArea, isFixedLayout, isFlushed, isKeepTogether, isNotFittingHeight, isNotFittingLayoutArea, isNotFittingWidth, isOverflowFit, isOverflowProperty, isOverflowProperty, isOverflowProperty, isPositioned, isRelativePosition, isStaticLayout, move, rectangleToPointsList, retrieveHeight, retrieveMaxHeight, retrieveMaxWidth, retrieveMinHeight, retrieveMinWidth, retrieveUnitValue, retrieveUnitValue, retrieveWidth, setBorders, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, toString, transformPoints, updateHeight, updateHeightsOnSplit, updateMaxHeight, updateMinHeight, updateWidth
-
Field Details
-
document
-
wrappedContentPage
-
targetCounterHandler
-
-
Constructor Details
-
DocumentRenderer
-
DocumentRenderer
-
-
Method Details
-
getTargetCounterHandler
Get handler for target-counters.- Returns:
-
the
TargetCounterHandler
instance
-
isRelayoutRequired
public boolean isRelayoutRequired()Indicates if relayout is required for targetCounterHandler.- Returns:
- true if relayout is required, false otherwise
-
getOccupiedArea
Description copied from class:AbstractRenderer
Gets the resultant occupied area after the last call to theIRenderer.layout(LayoutContext)
method.- Specified by:
-
getOccupiedArea
in interfaceIRenderer
- Overrides:
-
getOccupiedArea
in classAbstractRenderer
- Returns:
-
LayoutArea
instance
-
getNextRenderer
ForDocumentRenderer
, this has a meaning of the renderer that will be used for relayout.- Returns:
- relayout renderer.
-
updateCurrentArea
- Specified by:
-
updateCurrentArea
in classRootRenderer
-
flushSingleRenderer
- Specified by:
-
flushSingleRenderer
in classRootRenderer
-
addNewPage
Adds new page with defined page size to PDF document.- Parameters:
-
customPageSize
- the size of new page, can be null - Returns:
- the page size of created page
-
ensureDocumentHasNPages
Ensures that PDF document has n pages. If document has fewer pages, adds new pages by callingaddNewPage(PageSize)
method.- Parameters:
-
n
- the expected number of pages if document -
customPageSize
- the size of created pages, can be null - Returns:
- the page size of the last created page, or null if no page was created
-