public class

TextFormElement

extends FormElement
java.lang.Object
   ↳ com.pspdfkit.forms.FormElement
     ↳ com.pspdfkit.forms.TextFormElement

Class Overview

Represents a text control in a PDF form. Allows the user to enter custom text.

See Also

Summary

Public Methods
String getEditingContents()
Returns the editing contents of this form element based on rules in the annotation (including JavaScript).
TextFormField getFormField()
Retrieve parent form field.
String getFormattedContents()
Returns the formatted contents of this form element based on rules in the annotation (including JavaScript)
TextInputFormat getInputFormat()
Input format of this text field.
int getMaxLength()
Maximum length of text allowed in the text field.
String getRichText()
Current rich text value.
String getText()
Current text value.
FormType getType()
Gets form type for TextFormElement.
boolean isComb()
Returns whether the field shall be automatically divided into as many equally space positions, or combs, as the value of getMaxLength(), and the text is laid out into those combs.
boolean isFileSelect()
Returns whether text entered in the field represents the pathname of a file whose contents shall be submitted as the value of the field.
boolean isMultiLine()
Returns whether text is allowed to have multiple lines or not.
boolean isPassword()
Returns whether text is intended for entering a secure password that should not be visible on the screen.
boolean isRichText()
Returns whether the value of this field can be a rich text string.
boolean isScrollEnabled()
Returns whether the text field can be scrolled (horizontally for single-line fields, vertically for multi-line fields).
boolean isSpellCheckEnabled()
Returns whether text entered in the field shall be spell-checked.
void setRichText(String richText)
Sets the current rich text value.
boolean setText(String text)
Sets the current text value.
[Expand]
Inherited Methods
From class com.pspdfkit.forms.FormElement
From class java.lang.Object

Public Methods

public String getEditingContents ()

Returns the editing contents of this form element based on rules in the annotation (including JavaScript). The editing contents of a form field are the contents that are shown when the user is editing a form field. These contents may be different from the form field value in some situations. For example, when the form field is prepared to show numbers with a comma decimal separator, the editing contents should also contain a decimal comma so that the user can edit the form field without causing keystroke validation errors that would prevent input.

Returns
  • Editing contents of this form element or null if the field does not have editing contents (for example, because it doesn't have formatting scripts).

public TextFormField getFormField ()

Retrieve parent form field.

Returns
  • Attached parent form field.

public String getFormattedContents ()

Returns the formatted contents of this form element based on rules in the annotation (including JavaScript)

Returns
  • Formatted contents of this form element or null if contents could not be formatted.

public TextInputFormat getInputFormat ()

Input format of this text field.

Returns
  • Input format of this text field.

public int getMaxLength ()

Maximum length of text allowed in the text field.

Returns
  • Maximum length of text allowed or 0 if length is unlimited.

public String getRichText ()

Current rich text value.

Returns
  • The current rich text value or null if no rich text has been set.

public String getText ()

Current text value.

Returns
  • The current text value or null if no text has been set.

public FormType getType ()

Gets form type for TextFormElement. See FormType.

Returns

public boolean isComb ()

Returns whether the field shall be automatically divided into as many equally space positions, or combs, as the value of getMaxLength(), and the text is laid out into those combs.

Returns
  • true when dividing into combs is enabled.

public boolean isFileSelect ()

Returns whether text entered in the field represents the pathname of a file whose contents shall be submitted as the value of the field.

Returns
  • true when file selection dialog should appear and file content should be uploaded.

public boolean isMultiLine ()

Returns whether text is allowed to have multiple lines or not.

Returns
  • true when text is allowed to span multiple lines.

public boolean isPassword ()

Returns whether text is intended for entering a secure password that should not be visible on the screen.

Returns
  • true when text should be not echoed on screen.

public boolean isRichText ()

Returns whether the value of this field can be a rich text string.

Returns
  • true when field supports rich text content.

public boolean isScrollEnabled ()

Returns whether the text field can be scrolled (horizontally for single-line fields, vertically for multi-line fields). Once the field is full, no further text shall be accepted for interactive form filling. For non-interactive form filling, the filler should take care not to add more character than will visibly fit in the defined area.

Returns
  • true when text scrolling is enabled.

public boolean isSpellCheckEnabled ()

Returns whether text entered in the field shall be spell-checked.

Returns
  • true when text content can be spell checked.

public void setRichText (String richText)

Sets the current rich text value.

public boolean setText (String text)

Sets the current text value.

Returns
  • true if the text field's text was updated, otherwise false.