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
FieldsFields inherited from class RootRenderer
currentArea, floatRendererAreas, immediateFlush, waitingDrawingElementsFields inherited from class AbstractRenderer
BOTTOM_SIDE, childRenderers, EPS, flushed, INF, isLastRendererForModelElement, LEFT_SIDE, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties, RIGHT_SIDE, TOP_SIDE -
Constructor Summary
ConstructorsConstructorDescriptionDocumentRenderer(Document document) DocumentRenderer(Document document, boolean immediateFlush) -
Method Summary
Modifier and TypeMethodDescriptionprotected PageSizeaddNewPage(PageSize customPageSize) Adds new page with defined page size to PDF document.protected PageSizeensureDocumentHasNPages(int n, PageSize customPageSize) Ensures that PDF document has n pages.protected voidflushSingleRenderer(IRenderer resultRenderer) private RectanglegetCurrentPageEffectiveArea(PageSize pageSize) 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.booleanIndicates if relayout is required for targetCounterHandler.private voidpossiblyFlushPreviousPage(int currentPageNumber) protected LayoutAreaupdateCurrentArea(LayoutResult overflowResult) Methods inherited from class RootRenderer
addChild, close, flush, flushWaitingDrawingElements, flushWaitingDrawingElements, getCurrentArea, layout, linkRenderToDocument, shrinkCurrentAreaAndProcessRendererMethods inherited from class AbstractRenderer
addAllChildRenderers, addAllChildRenderers, addAllProperties, addChildRenderer, alignChildHorizontally, allowLastYLineRecursiveExtraction, applyAbsolutePosition, applyAbsolutePositionIfNeeded, applyAction, applyBorderBox, applyBorderBox, applyDestination, applyDestinationsAndAnnotation, applyLinkAnnotation, applyMargins, applyMargins, applyMarginsBordersPaddings, applyPaddings, applyPaddings, applyRelativePositioningTranslation, beginElementOpacityApplying, beginTransformationIfApplied, calculateAbsolutePdfBBox, calculateAdditionalWidth, calculateBBox, calculatePaddingBorderHeight, calculatePaddingBorderWidth, calculateShiftToPositionBBoxOfPointsAt, clipBackgroundArea, clipBackgroundArea, clipBorderArea, createFontCharacteristics, createXObject, deleteOwnProperty, deleteProperty, draw, drawBackground, drawBorder, drawChildren, drawPositionedChildren, endElementOpacityApplying, endTransformationIfApplied, getAspectRatio, getBackgroundArea, getBorderAreaBBox, getBorderRadii, getBorders, getBorders, getChildRenderers, getDefaultProperty, getFirstYLineRecursively, getInnerAreaBBox, getLastYLineRecursively, getMargins, getMinMaxWidth, getMinMaxWidth, getModelElement, getOccupiedAreaBBox, getOwnProperties, getOwnProperty, getPaddings, getParent, getPdfDocument, getProperty, getProperty, getPropertyAsBoolean, getPropertyAsColor, getPropertyAsFloat, getPropertyAsFloat, getPropertyAsFloat, getPropertyAsFont, getPropertyAsInteger, getPropertyAsTransparentColor, getPropertyAsUnitValue, getPropertyAsUnitValue, getRootRenderer, hasAbsoluteUnitValue, hasAspectRatio, hasOwnOrModelProperty, hasOwnProperty, hasProperty, hasRelativeUnitValue, initElementAreas, isAbsolutePosition, isBorderBoxSizing, isFirstOnRootArea, isFirstOnRootArea, isFixedLayout, isFlushed, isKeepTogether, isKeepTogether, isNotFittingHeight, isNotFittingLayoutArea, isNotFittingWidth, isOverflowFit, isOverflowProperty, isOverflowProperty, isOverflowProperty, isPositioned, isRelativePosition, isStaticLayout, logWarningIfGetNextRendererNotOverridden, move, noAbsolutePositionInfo, preparePositionedRendererAndAreaForLayout, processWaitingDrawing, rectangleToPointsList, removeAllChildRenderers, removeChildRenderer, replaceOwnProperty, resolveFirstPdfFont, resolveFirstPdfFont, retrieveHeight, retrieveMaxHeight, retrieveMaxWidth, retrieveMinHeight, retrieveMinWidth, retrieveResolvedDeclaredHeight, retrieveUnitValue, retrieveUnitValue, retrieveWidth, returnBackOwnProperty, setBorders, setChildRenderer, setChildRenderers, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, setThisAsParent, shrinkOccupiedAreaForAbsolutePosition, toString, transformPoints, updateHeight, updateHeightsOnSplit, updateHeightsOnSplit, updateMaxHeight, updateMinHeight, updateWidth
-
Field Details
-
document
-
wrappedContentPage
-
targetCounterHandler
-
-
Constructor Details
-
DocumentRenderer
-
DocumentRenderer
-
-
Method Details
-
getTargetCounterHandler
Get handler for target-counters.- Returns:
- the
TargetCounterHandlerinstance
-
isRelayoutRequired
public boolean isRelayoutRequired()Indicates if relayout is required for targetCounterHandler.- Returns:
- true if relayout is required, false otherwise
-
getOccupiedArea
Description copied from class:AbstractRendererGets the resultant occupied area after the last call to theIRenderer.layout(LayoutContext)method.- Specified by:
getOccupiedAreain interfaceIRenderer- Overrides:
getOccupiedAreain classAbstractRenderer- Returns:
LayoutAreainstance
-
getNextRenderer
ForDocumentRenderer, this has a meaning of the renderer that will be used for relayout.- Returns:
- relayout renderer.
-
updateCurrentArea
- Specified by:
updateCurrentAreain classRootRenderer
-
flushSingleRenderer
- Specified by:
flushSingleRendererin classRootRenderer
-
addNewPage
-
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 documentcustomPageSize- the size of created pages, can be null- Returns:
- the page size of the last created page, or null if no page was created
-
getCurrentPageEffectiveArea
-
possiblyFlushPreviousPage
private void possiblyFlushPreviousPage(int currentPageNumber)
-