Package com.itextpdf.layout.renderer
Class LinkRenderer
- java.lang.Object
-
- com.itextpdf.layout.renderer.AbstractRenderer
-
- com.itextpdf.layout.renderer.TextRenderer
-
- com.itextpdf.layout.renderer.LinkRenderer
-
- All Implemented Interfaces:
IPropertyContainer,ILeafElementRenderer,IRenderer
public class LinkRenderer extends TextRenderer
-
-
Field Summary
-
Fields inherited from class com.itextpdf.layout.renderer.TextRenderer
line, otfFeaturesApplied, reversedRanges, savedWordBreakAtLineEnding, strToBeConverted, tabAnchorCharacterPosition, text, TEXT_SPACE_COEFF, TYPO_ASCENDER_SCALE_COEFF, UNDEFINED_FIRST_CHAR_TO_FORCE_OVERFLOW, yLineOffset
-
Fields inherited from class com.itextpdf.layout.renderer.AbstractRenderer
BOTTOM_SIDE, childRenderers, EPS, flushed, INF, isLastRendererForModelElement, LEFT_SIDE, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties, RIGHT_SIDE, TOP_SIDE
-
-
Constructor Summary
Constructors Constructor Description LinkRenderer(Link link)Creates a LinkRenderer from its corresponding layout object.LinkRenderer(Link linkElement, java.lang.String text)Creates a LinkRenderer from its corresponding layout object, with a custom text to replace the contents of theLink.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw(DrawContext drawContext)Flushes the renderer subtree contents, i.e.IRenderergetNextRenderer()Gets a new instance of this class to be used as a next renderer, after this renderer is used, ifTextRenderer.layout(LayoutContext)is called more than once.-
Methods inherited from class com.itextpdf.layout.renderer.TextRenderer
applyOtf, baseCharactersCount, calculateAscenderDescender, calculateAscenderDescender, calculateLineWidth, charAt, codePointIsOfSpecialScript, createCopy, createOverflowRenderer, createSplitRenderer, drawSingleUnderline, findPossibleBreaksSplitPosition, getAscent, getBackgroundArea, getDescent, getFirstYLineRecursively, getLastYLineRecursively, getMinMaxWidth, getNumberOfSpaces, getReversedRanges, getSpecialScriptFirstNotFittingIndex, getSpecialScriptsWordBreakPoints, getTabAnchorCharacterPosition, getText, getYLine, initReversedRanges, isStartsWithSplitCharWhiteSpaceAndEndsWithSplitChar, layout, length, lineLength, moveYLineTo, removeReversedRanges, resolveFirstPdfFont, resolveFonts, setIndexOfFirstCharacterToBeForcedToOverflow, setProcessedGlyphLineAndFont, setSpecialScriptFirstNotFittingIndex, setSpecialScriptsWordBreakPoints, setText, setText, split, textContainsSpecialScriptGlyphs, toString, trimFirst, trimLast, updateRangeBasedOnRemovedCharacters
-
Methods inherited from class com.itextpdf.layout.renderer.AbstractRenderer
addAllChildRenderers, addAllChildRenderers, addAllProperties, addChild, 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, drawBackground, drawBorder, drawChildren, drawPositionedChildren, endElementOpacityApplying, endTransformationIfApplied, getAspectRatio, getBorderAreaBBox, getBorderRadii, getBorders, getBorders, getChildRenderers, getDefaultProperty, getInnerAreaBBox, getMargins, getMinMaxWidth, getModelElement, getOccupiedArea, 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, retrieveHeight, retrieveMaxHeight, retrieveMaxWidth, retrieveMinHeight, retrieveMinWidth, retrieveResolvedDeclaredHeight, retrieveUnitValue, retrieveUnitValue, retrieveWidth, returnBackOwnProperty, setBorders, setChildRenderer, setChildRenderers, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, setThisAsParent, shrinkOccupiedAreaForAbsolutePosition, transformPoints, updateHeight, updateHeightsOnSplit, updateHeightsOnSplit, updateMaxHeight, updateMinHeight, updateWidth
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.itextpdf.layout.IPropertyContainer
deleteOwnProperty, getDefaultProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setProperty
-
Methods inherited from interface com.itextpdf.layout.renderer.IRenderer
addChild, getChildRenderers, getModelElement, getOccupiedArea, getParent, getProperty, isFlushed, move, setParent
-
-
-
-
Method Detail
-
draw
public void draw(DrawContext drawContext)
Description copied from class:AbstractRendererFlushes the renderer subtree contents, i.e. draws itself on canvas, adds necessary objects to thePdfDocumentetc.- Specified by:
drawin interfaceIRenderer- Overrides:
drawin classTextRenderer- Parameters:
drawContext- contains thePdfDocumentto which the renderer subtree if flushed, thePdfCanvason which the renderer subtree is drawn and other additional parameters needed to perform drawing
-
getNextRenderer
public IRenderer getNextRenderer()
Gets a new instance of this class to be used as a next renderer, after this renderer is used, ifTextRenderer.layout(LayoutContext)is called more than once.If a renderer overflows to the next area, iText uses this method to create a renderer for the overflow part. So if one wants to extend
LinkRenderer, one should override this method: otherwise the default method will be used and thus the default rather than the custom renderer will be created.- Specified by:
getNextRendererin interfaceIRenderer- Overrides:
getNextRendererin classTextRenderer- Returns:
- new renderer instance
-
-