Class PDVariableText
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.form.PDField
org.apache.pdfbox.pdmodel.interactive.form.PDVariableText
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDChoiceField
,PDTextbox
A class for handling PDF fields that display text.
- Version:
- $Revision: 1.7 $
- Author:
- Ben Litchfield
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
A Ff flag.static final int
A Ff flag.static final int
A Ff flag.static final int
A Ff flag.static final int
A Ff flag.static final int
A Ff flag.static final int
A Ff flag.static final int
A Q value.static final int
A Q value.static final int
A Q value.Fields inherited from class org.apache.pdfbox.pdmodel.interactive.form.PDField
FLAG_NO_EXPORT, FLAG_READ_ONLY, FLAG_REQUIRED
-
Constructor Summary
ConstructorsConstructorDescriptionPDVariableText
(PDAcroForm theAcroForm) PDVariableText
(PDAcroForm theAcroForm, COSDictionary field) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
protected COSString
int
getQ()
This will get the 'quadding' or justification of the text to be displayed.getValue()
getValue gets the fields value to as a string.boolean
boolean
boolean
boolean
void
setComb
(boolean comb) Set the comb bit.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
setMultiline
(boolean multiline) Set the multiline bit.void
setPassword
(boolean password) Set the password bit.void
setQ
(int q) This will set the quadding/justification of the text.void
setRichText
(boolean richText) Set the richText bit.void
setValue sets the fields value to a given string.boolean
Methods inherited from class org.apache.pdfbox.pdmodel.interactive.form.PDField
findFieldType, findKid, getAcroForm, getActions, getAlternateFieldName, getCOSObject, getDictionary, getFieldFlags, getFieldType, getFullyQualifiedName, getKids, getParent, getPartialName, getWidget, getWidgets, importFDF, isNoExport, isReadonly, isRequired, setAcroForm, setActions, setAlternateFieldName, setFieldFlags, setFieldType, setKids, setNoExport, setParent, setPartialName, setReadonly, setRequired, toString
-
Field Details
-
FLAG_MULTILINE
public static final int FLAG_MULTILINEA Ff flag.- See Also:
-
FLAG_PASSWORD
public static final int FLAG_PASSWORDA Ff flag.- See Also:
-
FLAG_FILE_SELECT
public static final int FLAG_FILE_SELECTA Ff flag.- See Also:
-
FLAG_DO_NOT_SPELL_CHECK
public static final int FLAG_DO_NOT_SPELL_CHECKA Ff flag.- See Also:
-
FLAG_DO_NOT_SCROLL
public static final int FLAG_DO_NOT_SCROLLA Ff flag.- See Also:
-
FLAG_COMB
public static final int FLAG_COMBA Ff flag.- See Also:
-
FLAG_RICH_TEXT
public static final int FLAG_RICH_TEXTA Ff flag.- See Also:
-
QUADDING_LEFT
public static final int QUADDING_LEFTA Q value.- See Also:
-
QUADDING_CENTERED
public static final int QUADDING_CENTEREDA Q value.- See Also:
-
QUADDING_RIGHT
public static final int QUADDING_RIGHTA Q value.- See Also:
-
-
Constructor Details
-
PDVariableText
- Parameters:
theAcroForm
- The acroform.- See Also:
-
PDVariableText
- Parameters:
theAcroForm
- The acroForm for this field.field
- The field's dictionary.- See Also:
-
-
Method Details
-
setValue
Description copied from class:PDField
setValue sets the fields value to a given string.- Specified by:
setValue
in classPDField
- Parameters:
value
- The new value for this text field.- Throws:
IOException
- If there is an error calculating the appearance stream.- See Also:
-
getValue
getValue gets the fields value to as a string.- Specified by:
getValue
in classPDField
- Returns:
- The string value of this field.
- Throws:
IOException
- If there is an error getting the value.
-
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.
-
shouldComb
public boolean shouldComb()- Returns:
- true if the field is supposed 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.
-
getDefaultAppearance
- Returns:
- the DA element of the dictionary object
-
getQ
public int getQ()This will get the 'quadding' or justification of the text to be displayed. 0 - Left(default)
1 - Centered
2 - Right
Please see the QUADDING_CONSTANTS.- Returns:
- The justification of the text strings.
-
setQ
public void setQ(int q) This will set the quadding/justification of the text. See QUADDING constants.- Parameters:
q
- The new text justification.
-