Class PDChoiceField
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.form.PDField
org.apache.pdfbox.pdmodel.interactive.form.PDVariableText
org.apache.pdfbox.pdmodel.interactive.form.PDChoiceField
- All Implemented Interfaces:
COSObjectable
A class for handling the PDF field as a choicefield.
- Version:
- $Revision: 1.7 $
- Author:
- sug
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
A Ff flag.static final int
A Ff flag.Fields inherited from class org.apache.pdfbox.pdmodel.interactive.form.PDVariableText
FLAG_COMB, FLAG_DO_NOT_SCROLL, FLAG_DO_NOT_SPELL_CHECK, FLAG_FILE_SELECT, FLAG_MULTILINE, FLAG_PASSWORD, FLAG_RICH_TEXT, QUADDING_CENTERED, QUADDING_LEFT, QUADDING_RIGHT
Fields inherited from class org.apache.pdfbox.pdmodel.interactive.form.PDField
FLAG_NO_EXPORT, FLAG_READ_ONLY, FLAG_REQUIRED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis will get the option values "Opt".This will get the indices of the selected options "I".int
This will get the top index "TI" value.void
setValue sets the fields value to a given string.Methods inherited from class org.apache.pdfbox.pdmodel.interactive.form.PDVariableText
doNotScroll, doNotSpellCheck, getDefaultAppearance, getQ, getValue, isFileSelect, isMultiline, isPassword, isRichText, setComb, setDoNotScroll, setDoNotSpellCheck, setFileSelect, setMultiline, setPassword, setQ, setRichText, shouldComb
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_COMBO
public static final int FLAG_COMBOA Ff flag.- See Also:
-
FLAG_EDIT
public static final int FLAG_EDITA Ff flag.- See Also:
-
-
Constructor Details
-
PDChoiceField
- Parameters:
theAcroForm
- The acroForm for this field.field
- The field for this choice field.- See Also:
-
-
Method Details
-
setValue
Description copied from class:PDField
setValue sets the fields value to a given string.- Overrides:
setValue
in classPDVariableText
- Parameters:
optionValue
- The new value for this text field.- Throws:
IOException
- If there is an error calculating the appearance stream or the value in not one of the existing options.- See Also:
-
getSelectedOptions
This will get the indices of the selected options "I".- Returns:
- COSArray containing the indices of all selected options.
-
getTopIndex
public int getTopIndex()This will get the top index "TI" value. The value returned will be the first item to display in the listbox.- Returns:
- the top index, default value 0.
-
getOptions
This will get the option values "Opt".- Returns:
- COSArray containing all options.
-