java.lang.Object | ||
↳ | com.pspdfkit.forms.FormElement | |
↳ | com.pspdfkit.forms.TextFormElement |
Represents a text control in a PDF form. Allows the user to enter custom text.
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 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
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.
null
if the field does not have
editing contents (for example, because it doesn't have formatting scripts).
Retrieve parent form field.
Returns the formatted contents of this form element based on rules in the annotation (including JavaScript)
null
if contents could not be
formatted.
Input format of this text field.
Maximum length of text allowed in the text field.
Current rich text value.
null
if no rich text has been set.
Current text value.
null
if no text has been set.
Gets form type for TextFormElement
. See FormType
.
TextFormElement
.
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.
true
when dividing into combs is enabled.
Returns whether text entered in the field represents the pathname of a file whose contents shall be submitted as the value of the field.
true
when file selection dialog should appear and file content should be
uploaded.
Returns whether text is allowed to have multiple lines or not.
true
when text is allowed to span multiple lines.
Returns whether text is intended for entering a secure password that should not be visible on the screen.
true
when text should be not echoed on screen.
Returns whether the value of this field can be a rich text string.
true
when field supports rich text content.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.
true
when text scrolling is enabled.
Returns whether text entered in the field shall be spell-checked.
true
when text content can be spell checked.
Sets the current text value.
true
if the text field's text was updated, otherwise false
.