Class AbstractTextFieldRenderer
java.lang.Object
com.itextpdf.layout.renderer.AbstractRenderer
com.itextpdf.layout.renderer.BlockRenderer
com.itextpdf.forms.form.renderer.AbstractFormFieldRenderer
com.itextpdf.forms.form.renderer.AbstractTextFieldRenderer
- All Implemented Interfaces:
IPropertyContainer, IRenderer
- Direct Known Subclasses:
AbstractOneLineTextFieldRenderer, SignatureAppearanceRenderer, TextAreaRenderer
Abstract
AbstractFormFieldRenderer for form fields with text content.-
Field Summary
FieldsFields inherited from class AbstractFormFieldRenderer
flatRendererFields inherited from class AbstractRenderer
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTextFieldRenderer(IFormField modelElement) Creates a newAbstractTextFieldRendererinstance. -
Method Summary
Modifier and TypeMethodDescription(package private) voidadjustNumberOfContentLines(List<LineRenderer> lines, Rectangle bBox, float height) Adjust number of content lines.(package private) voidadjustNumberOfContentLines(List<LineRenderer> lines, Rectangle bBox, int rows) Adjust number of content lines.private static voidadjustNumberOfContentLines(List<LineRenderer> lines, Rectangle bBox, int linesNumber, float height) (package private) voidapplyDefaultFieldProperties(PdfFormField inputField) Applies the default field properties.(package private) floatapproximateFontSize(LayoutContext layoutContext, float lFontSize, float rFontSize) Approximates font size to fit occupied area if width anf height are specified.(package private) floatcalculateFittingFontSize(IRenderer renderer, float lFontSize, float rFontSize, LayoutContext newLayoutContext, int numberOfIterations) (package private) IRenderercreateParagraphRenderer(String defaultValue) Creates a paragraph renderer.(package private) floatgetHeightRowsBased(List<LineRenderer> lines, Rectangle bBox, int rows) (package private) floatgetLowestChildBottom(IRenderer renderer, float value) Gets the value of the lowest bottom coordinate for all field's children recursively.(package private) floatupdateHtmlColsSizeBasedWidth(float width) (package private) voidupdatePdfFont(ParagraphRenderer renderer) Updates the font.Methods inherited from class AbstractFormFieldRenderer
adjustFieldLayout, applyAccessibilityProperties, applyAcroField, createFlatRenderer, draw, drawChildren, getConformance, getDefaultValue, getLang, getMinMaxWidth, getModelId, isFlatten, isLayoutBasedOnFlatRenderer, isRendererFit, layout, writeAcroFormFieldLangAttributeMethods inherited from class BlockRenderer
applyRotationLayout, applyVerticalAlignment, beginRotationIfApplied, createOverflowRenderer, createRotationTransformInsideOccupiedArea, createSplitRenderer, endRotationIfApplied, getMinMaxWidth, getOccupiedAreaBBox, getResolvedFontMethods inherited from class 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, deleteOwnProperty, deleteProperty, drawBackground, drawBorder, endElementOpacityApplying, endTransformationIfApplied, getBackgroundArea, getBorderAreaBBox, getBorderRadii, getBorders, getChildRenderers, getDefaultProperty, getFirstYLineRecursively, getInnerAreaBBox, getLastYLineRecursively, getMargins, getModelElement, getOccupiedArea, 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, retrieveResolvedDeclaredHeight, retrieveUnitValue, retrieveUnitValue, retrieveWidth, setBorders, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, toString, transformPoints, updateHeight, updateHeightsOnSplit, updateMaxHeight, updateMinHeight, updateWidthMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IRenderer
getNextRenderer
-
Field Details
-
font
The font to be used for the text.
-
-
Constructor Details
-
AbstractTextFieldRenderer
AbstractTextFieldRenderer(IFormField modelElement) Creates a newAbstractTextFieldRendererinstance.- Parameters:
modelElement- the model element
-
-
Method Details
-
createParagraphRenderer
-
applyDefaultFieldProperties
Applies the default field properties.- Parameters:
inputField- the input field
-
getHeightRowsBased
-
updatePdfFont
Updates the font.- Parameters:
renderer- the renderer
-
approximateFontSize
Approximates font size to fit occupied area if width anf height are specified.- Parameters:
layoutContext- layout context that specifies layout area.lFontSize- minimal font size value.rFontSize- maximum font size value.- Returns:
- fitting font size or -1 in case it shouldn't be approximated.
-
calculateFittingFontSize
float calculateFittingFontSize(IRenderer renderer, float lFontSize, float rFontSize, LayoutContext newLayoutContext, int numberOfIterations) -
updateHtmlColsSizeBasedWidth
float updateHtmlColsSizeBasedWidth(float width) -
adjustNumberOfContentLines
Adjust number of content lines.- Parameters:
lines- the lines that need to be renderedbBox- the bounding boxrows- the desired number of lines
-
adjustNumberOfContentLines
Adjust number of content lines.- Parameters:
lines- the lines that need to be renderedbBox- the bounding boxheight- the desired height of content
-
getLowestChildBottom
Gets the value of the lowest bottom coordinate for all field's children recursively.- Returns:
- the lowest child bottom.
-
adjustNumberOfContentLines
private static void adjustNumberOfContentLines(List<LineRenderer> lines, Rectangle bBox, int linesNumber, float height)
-