public final class PDTextField extends PDVariableText
Modifier and Type | Field and Description |
---|---|
private static int |
FLAG_COMB |
private static int |
FLAG_DO_NOT_SCROLL |
private static int |
FLAG_DO_NOT_SPELL_CHECK |
private static int |
FLAG_FILE_SELECT |
private static int |
FLAG_MULTILINE |
private static int |
FLAG_PASSWORD |
private static int |
FLAG_RICH_TEXT |
QUADDING_CENTERED, QUADDING_LEFT, QUADDING_RIGHT
Constructor and Description |
---|
PDTextField(PDAcroForm acroForm) |
PDTextField(PDAcroForm acroForm,
COSDictionary field,
PDNonTerminalField parent)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
constructAppearances()
Constructs appearance streams and appearance dictionaries for all widget annotations.
|
boolean |
doNotScroll() |
boolean |
doNotSpellCheck() |
java.lang.String |
getDefaultValue()
Returns the default value of this field, or an empty string.
|
int |
getMaxLen()
Returns the maximum number of characters of the text field.
|
java.lang.String |
getValue()
Returns the value of this field, or an empty string.
|
java.lang.String |
getValueAsString()
Returns a string representation of the "V" entry, or an empty string.
|
boolean |
isComb() |
boolean |
isFileSelect() |
boolean |
isMultiline() |
boolean |
isPassword() |
boolean |
isRichText() |
void |
setComb(boolean comb)
Set the comb bit.
|
void |
setDefaultValue(java.lang.String value)
Sets the default value of this field.
|
void |
setDoNotScroll(boolean doNotScroll)
Set the doNotScroll bit.
|
void |
setDoNotSpellCheck(boolean doNotSpellCheck)
Set the doNotSpellCheck bit.
|
void |
setFileSelect(boolean fileSelect)
Set the file select bit.
|
void |
setMaxLen(int maxLen)
Sets the maximum number of characters of the text field.
|
void |
setMultiline(boolean multiline)
Set the multiline bit.
|
void |
setPassword(boolean password)
Set the password bit.
|
void |
setRichText(boolean richText)
Set the richText bit.
|
void |
setValue(java.lang.String value)
Sets the plain text value of this field.
|
getDefaultAppearance, getDefaultAppearanceString, getDefaultStyleString, getQ, getRichTextValue, getStringOrStream, setDefaultAppearance, setDefaultStyleString, setQ, setRichTextValue
applyChange, exportFDF, getFieldFlags, getFieldType, getWidget, getWidgets, importFDF, setActions, setWidgets
findKid, fromDictionary, getAcroForm, getActions, getAlternateFieldName, getCOSObject, getFullyQualifiedName, getInheritableAttribute, getMappingName, getParent, getPartialName, isNoExport, isReadOnly, isRequired, setAlternateFieldName, setFieldFlags, setMappingName, setNoExport, setPartialName, setReadOnly, setRequired, toString
private static final int FLAG_MULTILINE
private static final int FLAG_PASSWORD
private static final int FLAG_FILE_SELECT
private static final int FLAG_DO_NOT_SPELL_CHECK
private static final int FLAG_DO_NOT_SCROLL
private static final int FLAG_COMB
private static final int FLAG_RICH_TEXT
public PDTextField(PDAcroForm acroForm)
acroForm
- The acroform.PDField.PDField(PDAcroForm)
PDTextField(PDAcroForm acroForm, COSDictionary field, PDNonTerminalField parent)
acroForm
- The form that this field is part of.field
- the PDF object to represent as a field.parent
- the parent node of the nodepublic boolean isMultiline()
public void setMultiline(boolean multiline)
multiline
- The value for the multiline.public boolean isPassword()
public void setPassword(boolean password)
password
- The value for the password.public boolean isFileSelect()
public void setFileSelect(boolean fileSelect)
fileSelect
- The value for the fileSelect.public boolean doNotSpellCheck()
public void setDoNotSpellCheck(boolean doNotSpellCheck)
doNotSpellCheck
- The value for the doNotSpellCheck.public boolean doNotScroll()
public void setDoNotScroll(boolean doNotScroll)
doNotScroll
- The value for the doNotScroll.public boolean isComb()
public void setComb(boolean comb)
comb
- The value for the comb.public boolean isRichText()
public void setRichText(boolean richText)
richText
- The value for the richText.public int getMaxLen()
public void setMaxLen(int maxLen)
maxLen
- the maximum number of characterspublic void setValue(java.lang.String value) throws java.io.IOException
PDAcroForm.getNeedAppearances()
is true.public void setDefaultValue(java.lang.String value) throws java.io.IOException
value
- Plain textjava.io.IOException
- if the value could not be setpublic java.lang.String getValue()
public java.lang.String getDefaultValue()
public java.lang.String getValueAsString()
PDField
getValueAsString
in class PDField
void constructAppearances() throws java.io.IOException
PDTerminalField
PDTerminalField.applyChange()
.constructAppearances
in class PDTerminalField
java.io.IOException
- if the appearance couldn't be generated