Package com.itextpdf.forms.form.renderer
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 com.itextpdf.forms.form.renderer.AbstractFormFieldRenderer
flatRenderer
Fields inherited from class com.itextpdf.layout.renderer.AbstractRenderer
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractTextFieldRenderer
(IFormField modelElement) Creates a newAbstractTextFieldRenderer
instance. -
Method Summary
Modifier and TypeMethodDescription(package private) void
adjustNumberOfContentLines
(List<LineRenderer> lines, Rectangle bBox, float height) Adjust number of content lines.(package private) void
adjustNumberOfContentLines
(List<LineRenderer> lines, Rectangle bBox, int rows) Adjust number of content lines.private static void
adjustNumberOfContentLines
(List<LineRenderer> lines, Rectangle bBox, int linesNumber, float height) (package private) void
applyDefaultFieldProperties
(PdfFormField inputField) Applies the default field properties.(package private) float
approximateFontSize
(LayoutContext layoutContext, float lFontSize, float rFontSize) Approximates font size to fit occupied area if width anf height are specified.(package private) float
calculateFittingFontSize
(IRenderer renderer, float lFontSize, float rFontSize, LayoutContext newLayoutContext, int numberOfIterations) (package private) IRenderer
createParagraphRenderer
(String defaultValue) Creates a paragraph renderer.(package private) float
getHeightRowsBased
(List<LineRenderer> lines, Rectangle bBox, int rows) (package private) float
getLowestChildBottom
(IRenderer renderer, float value) Gets the value of the lowest bottom coordinate for all field's children recursively.(package private) float
updateHtmlColsSizeBasedWidth
(float width) (package private) void
updatePdfFont
(ParagraphRenderer renderer) Updates the font.Methods inherited from class com.itextpdf.forms.form.renderer.AbstractFormFieldRenderer
adjustFieldLayout, applyAccessibilityProperties, applyAcroField, createFlatRenderer, draw, drawChildren, getConformanceLevel, getDefaultValue, getGenericConformanceLevel, getLang, getMinMaxWidth, getModelId, isFlatten, isLayoutBasedOnFlatRenderer, isRendererFit, layout, writeAcroFormFieldLangAttribute
Methods inherited from class com.itextpdf.layout.renderer.BlockRenderer
applyRotationLayout, applyVerticalAlignment, beginRotationIfApplied, createOverflowRenderer, createRotationTransformInsideOccupiedArea, createSplitRenderer, endRotationIfApplied, getOccupiedAreaBBox, getResolvedFont
Methods 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, 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, retrieveUnitValue, retrieveUnitValue, retrieveWidth, setBorders, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, toString, transformPoints, updateHeight, 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.renderer.IRenderer
getNextRenderer
-
Field Details
-
font
The font to be used for the text.
-
-
Constructor Details
-
AbstractTextFieldRenderer
AbstractTextFieldRenderer(IFormField modelElement) Creates a newAbstractTextFieldRenderer
instance.- Parameters:
modelElement
- the model element
-
-
Method Details
-
createParagraphRenderer
Creates a paragraph renderer.- Parameters:
defaultValue
- the default value- Returns:
- the renderer
-
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)
-