Class PdfTextFormField


public class PdfTextFormField extends PdfFormField
An AcroForm field containing textual data.
  • Field Details

    • FF_FILE_SELECT

      public static final int FF_FILE_SELECT
      constant which determines whether field currently represents a path.
    • FF_DO_NOT_SPELL_CHECK

      public static final int FF_DO_NOT_SPELL_CHECK
      constant which determines whether spell-checking is currently enabled
    • FF_DO_NOT_SCROLL

      public static final int FF_DO_NOT_SCROLL
      constant which determines whether longer texts are currently allowed.
    • FF_COMB

      public static final int FF_COMB
      constant which determines maximum length of the field's text.
    • FF_RICH_TEXT

      public static final int FF_RICH_TEXT
      constant which determines whether text is currently represented as rich text.
  • Constructor Details

  • Method Details

    • getFormType

      public PdfName getFormType()
      Returns Tx, the form type for textual form fields.
      Overrides:
      getFormType in class PdfFormField
      Returns:
      the form type, as a PdfName
    • setMultiline

      public PdfTextFormField setMultiline (boolean multiline)
      If true, the field can contain multiple lines of text; if false, the field?s text is restricted to a single line.
      Parameters:
      multiline - whether or not the file can contain multiple lines of text
      Returns:
      current PdfTextFormField
    • setPassword

      public PdfTextFormField setPassword (boolean password)
      If true, the field is intended for entering a secure password that should not be echoed visibly to the screen. Characters typed from the keyboard should instead be echoed in some unreadable form, such as asterisks or bullet characters.
      Parameters:
      password - whether or not to obscure the typed characters
      Returns:
      current PdfTextFormField
    • isFileSelect

      public boolean isFileSelect()
      If true, the text entered in the field represents the pathname of a file whose contents are to be submitted as the value of the field.
      Returns:
      whether or not this field currently represents a path
    • setFileSelect

      public PdfTextFormField setFileSelect (boolean fileSelect)
      If true, the text entered in the field represents the pathname of a file whose contents are to be submitted as the value of the field.
      Parameters:
      fileSelect - whether or not this field should represent a path
      Returns:
      current PdfTextFormField
    • isSpellCheck

      public boolean isSpellCheck()
      If true, text entered in the field is spell-checked.
      Returns:
      whether or not spell-checking is currently enabled
    • setSpellCheck

      public PdfTextFormField setSpellCheck (boolean spellCheck)
      If true, text entered in the field is spell-checked.
      Parameters:
      spellCheck - whether or not to spell-check
      Returns:
      current PdfTextFormField
    • isScroll

      public boolean isScroll()
      If true, the field scrolls (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. Once the field is full, no further text is accepted.
      Returns:
      whether or not longer texts are currently allowed
    • setScroll

      public PdfTextFormField setScroll (boolean scroll)
      If true, the field scrolls (horizontally for single-line fields, vertically for multiple-line fields) to accommodate more text than fits within its annotation rectangle. Once the field is full, no further text is accepted.
      Parameters:
      scroll - whether or not to allow longer texts
      Returns:
      current PdfTextFormField
    • isComb

      public boolean isComb()
      Meaningful only if the MaxLen entry is present in the text field dictionary and if the Multiline, Password, and FileSelect flags are clear. If true, the field is automatically divided into as many equally spaced positions, or combs, as the value of MaxLen, and the text is laid out into those combs.
      Returns:
      whether or not combing is enabled
    • setComb

      public PdfTextFormField setComb (boolean comb)
      Meaningful only if the MaxLen entry is present in the text field dictionary and if the Multiline, Password, and FileSelect flags are clear. If true, the field is automatically divided into as many equally spaced positions, or combs, as the value of MaxLen, and the text is laid out into those combs.
      Parameters:
      comb - whether or not to enable combing
      Returns:
      current PdfTextFormField
    • isRichText

      public boolean isRichText()
      If true, the value of this field should be represented as a rich text string. If the field has a value, the RV entry of the field dictionary specifies the rich text string.
      Returns:
      whether or not text is currently represented as rich text
    • setRichText

      public PdfTextFormField setRichText (boolean richText)
      If true, the value of this field should be represented as a rich text string. If the field has a value, the RV entry of the field dictionary specifies the rich text string.
      Parameters:
      richText - whether or not to represent text as rich text
      Returns:
      current PdfTextFormField
    • getMaxLen

      public int getMaxLen()
      Gets the maximum length of the field's text, in characters. This is an optional parameter, so if it is not specified, 0 value will be returned.
      Returns:
      the current maximum text length
    • setMaxLen

      public PdfTextFormField setMaxLen (int maxLen)
      Sets the maximum length of the field's text, in characters.
      Parameters:
      maxLen - the maximum text length
      Returns:
      current