public class AcroTextField
extends java.lang.Object
Represents a text field in an interactive AcroForm.
Text fields can either be plain or 'rich'. Plain text fields return false
from AcroTextField.hasRichTextValue()
, and their getValue()
function
will return a simple String object. Rich text fields return true from
AcroTextField.hasRichTextValue()
, and their getValue()
function
will return an XHTML rich text string, as specified in Section 8.6.2 of the
PDF document specification.
FIELD_TYPE_BUTTON, FIELD_TYPE_CHOICE, FIELD_TYPE_OTHER, FIELD_TYPE_SIGNATURE, FIELD_TYPE_TEXT
Modifier and Type | Method and Description |
---|---|
boolean |
canChangeValue()
This function always returns true.
|
int |
getMaxLength()
Returns the maximum length of this field, as specified by this form field's /MaxLen entry.
|
java.lang.String |
getRichTextValue()
Returns the 'rich text' value for this field (XHTML that conforms to the XFA specification), if available.
|
boolean |
hasRichTextValue()
Returns true only if the value of this field is 'rich text' (XHTML that conforms to the XFA specification),
which may be retrieved via the
AcroTextField.getRichTextValue() function. |
boolean |
isFileSelection()
Returns true if this is field is designated to hold the path of a user-selected file.
|
boolean |
isMultiline()
Returns true if this is a multiline text field.
|
boolean |
isPasswordEntry()
Returns true if this is a password-entry text field.
|
boolean |
setValue(java.lang.String val)
Sets the value of this text field.
|
getDefaultValue, getFullName, getLocalName, getMappingName, getType, getUIName, getValue, hasValueChanged, isReadOnly
pageNumber
public boolean setValue(java.lang.String val)
setValue
in interface AcroFormField
public boolean canChangeValue()
canChangeValue
in interface AcroFormField
public int getMaxLength()
public java.lang.String getRichTextValue()
AcroFormField.getValue()
function.AcroTextField.hasRichTextValue()
public boolean isMultiline()
public boolean isPasswordEntry()
public boolean isFileSelection()
public boolean hasRichTextValue()
AcroTextField.getRichTextValue()
function. If this function returns false, then
the field's value is available via AcroFormField.getValue()
.AcroTextField.getRichTextValue()