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
public abstract class AbstractTextFieldRenderer extends AbstractFormFieldRenderer
AbstractAbstractFormFieldRendererfor form fields with text content.
-
-
Field Summary
Fields Modifier and Type Field Description protected PdfFontfontThe font to be used for the text.-
Fields 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
Constructors Constructor Description AbstractTextFieldRenderer(IFormField modelElement)Creates a newAbstractTextFieldRendererinstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidadjustNumberOfContentLines(java.util.List<LineRenderer> lines, Rectangle bBox, float height)Adjust number of content lines.(package private) voidadjustNumberOfContentLines(java.util.List<LineRenderer> lines, Rectangle bBox, int rows)Adjust number of content lines.private static voidadjustNumberOfContentLines(java.util.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(java.lang.String defaultValue)Creates a paragraph renderer.(package private) floatgetHeightRowsBased(java.util.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 com.itextpdf.forms.form.renderer.AbstractFormFieldRenderer
adjustFieldLayout, applyAccessibilityProperties, applyAcroField, createFlatRenderer, draw, drawChildren, getConformance, getDefaultValue, getLang, getMinMaxWidth, getModelId, isFlatten, isLayoutBasedOnFlatRenderer, isRendererFit, layout, writeAcroFormFieldLangAttribute
-
Methods inherited from class com.itextpdf.layout.renderer.BlockRenderer
applyRotationLayout, applyVerticalAlignment, beginRotationIfApplied, createOverflowRenderer, createRotationTransformInsideOccupiedArea, createSplitRenderer, endRotationIfApplied, getMinMaxWidth, 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, retrieveResolvedDeclaredHeight, 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 Detail
-
font
protected PdfFont font
The font to be used for the text.
-
-
Constructor Detail
-
AbstractTextFieldRenderer
AbstractTextFieldRenderer(IFormField modelElement)
Creates a newAbstractTextFieldRendererinstance.- Parameters:
modelElement- the model element
-
-
Method Detail
-
createParagraphRenderer
IRenderer createParagraphRenderer(java.lang.String defaultValue)
Creates a paragraph renderer.- Parameters:
defaultValue- the default value- Returns:
- the renderer
-
applyDefaultFieldProperties
void applyDefaultFieldProperties(PdfFormField inputField)
Applies the default field properties.- Parameters:
inputField- the input field
-
getHeightRowsBased
float getHeightRowsBased(java.util.List<LineRenderer> lines, Rectangle bBox, int rows)
-
updatePdfFont
void updatePdfFont(ParagraphRenderer renderer)
Updates the font.- Parameters:
renderer- the renderer
-
approximateFontSize
float approximateFontSize(LayoutContext layoutContext, float lFontSize, float rFontSize)
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
void adjustNumberOfContentLines(java.util.List<LineRenderer> lines, Rectangle bBox, int rows)
Adjust number of content lines.- Parameters:
lines- the lines that need to be renderedbBox- the bounding boxrows- the desired number of lines
-
adjustNumberOfContentLines
void adjustNumberOfContentLines(java.util.List<LineRenderer> lines, Rectangle bBox, float height)
Adjust number of content lines.- Parameters:
lines- the lines that need to be renderedbBox- the bounding boxheight- the desired height of content
-
getLowestChildBottom
float getLowestChildBottom(IRenderer renderer, float value)
Gets the value of the lowest bottom coordinate for all field's children recursively.- Returns:
- the lowest child bottom.
-
adjustNumberOfContentLines
private static void adjustNumberOfContentLines(java.util.List<LineRenderer> lines, Rectangle bBox, int linesNumber, float height)
-
-