java.lang.Object
org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
org.sejda.sambox.pdmodel.interactive.form.PDField
org.sejda.sambox.pdmodel.interactive.form.PDTerminalField
org.sejda.sambox.pdmodel.interactive.form.PDVariableText
org.sejda.sambox.pdmodel.interactive.form.PDTextField
- All Implemented Interfaces:
COSObjectable
A text field is a box or space for text fill-in data typically entered from a keyboard.
The text may be restricted to a single line or may be permitted to span multiple lines
- Author:
- sug
-
Field Summary
Fields inherited from class org.sejda.sambox.pdmodel.interactive.form.PDVariableText
QUADDING_CENTERED, QUADDING_LEFT, QUADDING_RIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanReturns the default value of this field, or an empty string.intReturns the maximum number of characters of the text field.getValue()Returns the value of this field, or an empty string.Returns a string representation of the "V" entry, or an empty string.booleanisComb()booleanbooleanbooleanbooleanvoidsetComb(boolean comb) Set the comb bit.voidsetDefaultValue(String value) Sets the default value of this field.voidsetDoNotScroll(boolean doNotScroll) Set the doNotScroll bit.voidsetDoNotSpellCheck(boolean doNotSpellCheck) Set the doNotSpellCheck bit.voidsetFileSelect(boolean fileSelect) Set the file select bit.voidsetMaxLen(int maxLen) Sets the maximum number of characters of the text field.voidsetMultiline(boolean multiline) Set the multiline bit.voidsetPassword(boolean password) Set the password bit.voidsetRichText(boolean richText) Set the richText bit.voidSets the plain text value of this field.Methods inherited from class org.sejda.sambox.pdmodel.interactive.form.PDVariableText
getAppearanceFont, getAppearanceOverrideFont, getDefaultAppearance, getDefaultStyleString, getQ, getRichTextValue, getStringOrStream, setAppearanceOverrideFont, setDefaultAppearance, setDefaultStyleString, setQ, setRichTextValueMethods inherited from class org.sejda.sambox.pdmodel.interactive.form.PDTerminalField
addWidgetIfMissing, applyChange, getFieldFlags, getFieldType, getWidgets, isTerminal, removeWidget, setActions, setWidgetsMethods inherited from class org.sejda.sambox.pdmodel.interactive.form.PDField
getAcroForm, getActions, getAlternateFieldName, getFullyQualifiedName, getInheritableAttribute, getMappingName, getParent, getPartialName, isNoExport, isReadonly, isRequired, setAlternateFieldName, setFieldFlags, setMappingName, setNoExport, setPartialName, setReadonly, setRequired, toStringMethods inherited from class org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
equals, getCOSObject, hashCode
-
Constructor Details
-
PDTextField
- Parameters:
acroForm- The acroform.- See Also:
-
PDField(PDAcroForm)
-
-
Method Details
-
isMultiline
public boolean isMultiline()- Returns:
- true if the field is multiline
-
setMultiline
public void setMultiline(boolean multiline) Set the multiline bit.- Parameters:
multiline- The value for the multiline.
-
isPassword
public boolean isPassword()- Returns:
- true if the field is a password field.
-
setPassword
public void setPassword(boolean password) Set the password bit.- Parameters:
password- The value for the password.
-
isFileSelect
public boolean isFileSelect()- Returns:
- true if the field is a file select field.
-
setFileSelect
public void setFileSelect(boolean fileSelect) Set the file select bit.- Parameters:
fileSelect- The value for the fileSelect.
-
doNotSpellCheck
public boolean doNotSpellCheck()- Returns:
- true if the field is not suppose to spell check.
-
setDoNotSpellCheck
public void setDoNotSpellCheck(boolean doNotSpellCheck) Set the doNotSpellCheck bit.- Parameters:
doNotSpellCheck- The value for the doNotSpellCheck.
-
doNotScroll
public boolean doNotScroll()- Returns:
- true if the field is not suppose to scroll.
-
setDoNotScroll
public void setDoNotScroll(boolean doNotScroll) Set the doNotScroll bit.- Parameters:
doNotScroll- The value for the doNotScroll.
-
isComb
public boolean isComb()- Returns:
- true if the field is not suppose to comb the text display.
-
setComb
public void setComb(boolean comb) Set the comb bit.- Parameters:
comb- The value for the comb.
-
isRichText
public boolean isRichText()- Returns:
- true if the field is a rich text field.
-
setRichText
public void setRichText(boolean richText) Set the richText bit.- Parameters:
richText- The value for the richText.
-
getMaxLen
public int getMaxLen()Returns the maximum number of characters of the text field.- Returns:
- the maximum number of characters, returns -1 if the value isn't present
-
setMaxLen
public void setMaxLen(int maxLen) Sets the maximum number of characters of the text field.- Parameters:
maxLen- the maximum number of characters
-
setValue
Sets the plain text value of this field.- Specified by:
setValuein classPDField- Parameters:
value- Plain text- Throws:
IOException- if the value could not be set
-
setDefaultValue
Sets the default value of this field.- Parameters:
value- Plain text- Throws:
IOException- if the value could not be set
-
getValue
Returns the value of this field, or an empty string.- Returns:
- A non-null string.
-
getDefaultValue
Returns the default value of this field, or an empty string.- Returns:
- A non-null string.
-
getValueAsString
Description copied from class:PDFieldReturns a string representation of the "V" entry, or an empty string.- Specified by:
getValueAsStringin classPDField- Returns:
- A non-null string.
-