Class AbstractTextFieldRenderer

All Implemented Interfaces:
IPropertyContainer, IRenderer
Direct Known Subclasses:
AbstractOneLineTextFieldRenderer, SignatureAppearanceRenderer, TextAreaRenderer

public abstract class AbstractTextFieldRenderer extends AbstractFormFieldRenderer
Abstract AbstractFormFieldRenderer for form fields with text content.
  • Field Details

    • font

      protected PdfFont font
      The font to be used for the text.
  • Constructor Details

  • Method Details

    • createParagraphRenderer

      IRenderer createParagraphRenderer(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(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(List<LineRenderer> lines, Rectangle bBox, int rows)
      Adjust number of content lines.
      Parameters:
      lines - the lines that need to be rendered
      bBox - the bounding box
      rows - the desired number of lines
    • adjustNumberOfContentLines

      void adjustNumberOfContentLines(List<LineRenderer> lines, Rectangle bBox, float height)
      Adjust number of content lines.
      Parameters:
      lines - the lines that need to be rendered
      bBox - the bounding box
      height - 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(List<LineRenderer> lines, Rectangle bBox, int linesNumber, float height)