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
-
Field Summary
Fields inherited from class com.itextpdf.layout.renderer.TextRenderer
line, otfFeaturesApplied, reversedRanges, savedWordBreakAtLineEnding, strToBeConverted, tabAnchorCharacterPosition, text, TEXT_SPACE_COEFF, yLineOffsetFields inherited from class com.itextpdf.layout.renderer.AbstractRenderer
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, isVerticalMode, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties -
Constructor Summary
ConstructorsModifierConstructorDescriptionLinkRenderer(Link link) Creates a LinkRenderer from its corresponding layout object.LinkRenderer(Link linkElement, String text) Creates a LinkRenderer from its corresponding layout object, with a custom text to replace the contents of theLink.protectedLinkRenderer(LinkRenderer other) Creates a newLinkRendereras a copy of the given one. -
Method Summary
Modifier and TypeMethodDescriptionprotected TextRenderercreateCopy(GlyphLine gl, PdfFont font) 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, createOverflowRenderer, createSplitRenderer, draw, drawSingleUnderline, getAscent, getBackgroundArea, getDescent, getFirstYLineRecursively, getLastYLineRecursively, getMinMaxWidth, getNumberOfSpaces, getTabAnchorCharacterPosition, getText, getYLine, layout, length, lineLength, moveYLineTo, resolveFonts, setProcessedGlyphLineAndFont, setText, setText, split, toString, trimFirstMethods inherited from class com.itextpdf.layout.renderer.AbstractRenderer
addAllProperties, addChild, alignChildHorizontally, allowLastYLineRecursiveExtraction, applyAbsolutePosition, applyAction, applyBorderBox, applyBorderBox, applyDestination, applyDestinationsAndAnnotation, applyLinkAnnotation, applyMargins, applyMargins, applyPaddings, applyPaddings, applyRelativePositioningTranslation, beginElementOpacityApplying, beginTransformationIfApplied, calculateAbsolutePdfBBox, calculateBBox, calculateShiftToPositionBBoxOfPointsAt, clipBackgroundArea, clipBackgroundArea, clipBorderArea, createXObject, createXObject, deleteOwnProperty, deleteProperty, drawBackground, drawBorder, drawChildren, endElementOpacityApplying, endTransformationIfApplied, getBorderAreaBBox, getBorderRadii, getBorders, getChildRenderers, getDefaultProperty, getInnerAreaBBox, getMargins, getMinMaxWidth, getModelElement, getOccupiedArea, getOccupiedAreaBBox, getOwnProperties, getOwnProperty, getPaddings, getParent, getPositionenRenderers, 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, retrieveResolvedDeclaredHeight, retrieveUnitValue, retrieveUnitValue, retrieveWidth, setBorders, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, transformPoints, updateHeight, updateHeightsOnSplit, updateMaxHeight, updateMinHeight, updateWidthMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.itextpdf.layout.IPropertyContainer
deleteOwnProperty, getDefaultProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setPropertyMethods inherited from interface com.itextpdf.layout.renderer.IRenderer
addChild, getChildRenderers, getModelElement, getOccupiedArea, getParent, getProperty, isFlushed, move, setParent
-
Constructor Details
-
LinkRenderer
Creates a LinkRenderer from its corresponding layout object.- Parameters:
-
link- theLinkwhich this object should manage
-
LinkRenderer
Creates a LinkRenderer from its corresponding layout object, with a custom text to replace the contents of theLink.- Parameters:
-
linkElement- theLinkwhich this object should manage -
text- the replacement text
-
LinkRenderer
Creates a newLinkRendereras a copy of the given one.- Parameters:
-
other- theLinkRendererto copy
-
-
Method Details
-
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
-
createCopy
Creates a copy of thisTextRenderer, which corresponds to the passedGlyphLinewithPdfFont.While processing
TextRenderer, iText uses this method to createglyph linesof specificfonts, which represent theTextRenderer's parts. If one extendsTextRenderer, one should override this method, otherwise ifFontSelectorrelated logic is triggered, copies of thisTextRendererwill have the default behavior rather than the custom one.- Overrides:
-
createCopyin classTextRenderer - Parameters:
-
gl- aGlyphLinewhich represents some of thisTextRenderer's content -
font- aPdfFontfor this part of theTextRenderer's content - Returns:
-
copy of this
TextRenderer, which correspond to the passedGlyphLinewithPdfFont
-