public class PdfChoiceFormField extends PdfFormField
| Modifier and Type | Field and Description |
|---|---|
static int |
FF_COMBO
If true, the field is a combo box.
|
static int |
FF_COMMIT_ON_SEL_CHANGE
If true, the new value shall be committed as soon as a selection is made (commonly with the pointing device).
|
static int |
FF_DO_NOT_SPELL_CHECK
If true, text entered in the field shall be spell-checked.
|
static int |
FF_EDIT
If true, the combo box shall include an editable text box as well as a drop-down list.
|
static int |
FF_MULTI_SELECT
If true, more than one of the field's option items may be selected simultaneously.
|
static int |
FF_SORT
If true, the field's option items shall be sorted alphabetically.
|
checkType, FF_MULTILINE, FF_NO_EXPORT, FF_PASSWORD, FF_READ_ONLY, FF_REQUIRED, form, img, textcolor, DEFAULT_FONT_SIZE, font, fontSize, MIN_FONT_SIZE, parent, pdfAConformanceLevel| Modifier | Constructor and Description |
|---|---|
protected |
PdfChoiceFormField(PdfDictionary pdfObject)
Creates a choice form field as a wrapper object around a
PdfDictionary. |
protected |
PdfChoiceFormField(PdfDocument pdfDocument)
Creates a minimal
PdfChoiceFormField. |
protected |
PdfChoiceFormField(PdfWidgetAnnotation widget,
PdfDocument pdfDocument)
Creates a choice form field as a parent of a
PdfWidgetAnnotation. |
| Modifier and Type | Method and Description |
|---|---|
PdfName |
getFormType()
Returns
Ch, the form type for choice form fields. |
PdfArray |
getIndices()
Gets the currently selected items in the field
|
PdfNumber |
getTopIndex()
Gets the current index of the first option in a scrollable list.
|
boolean |
isCombo()
If true, the field is a combo box; if false, the field is a list box.
|
boolean |
isCommitOnSelChange()
If true, the new value shall be committed as soon as a selection is made (commonly with the pointing device).
|
boolean |
isEdit()
If true, the combo box shall include an editable text box as well as a
drop-down list; if false, it shall include only a drop-down list.
|
boolean |
isMultiSelect()
If true, more than one of the field's option items may be selected simultaneously; if false, at most one item
shall be selected.
|
boolean |
isSort()
If true, the field's option items shall be sorted alphabetically.
|
boolean |
isSpellCheck()
If true, text entered in the field shall be spell-checked..
|
PdfChoiceFormField |
setCombo(boolean combo)
If true, the field is a combo box; if false, the field is a list box.
|
PdfChoiceFormField |
setCommitOnSelChange(boolean commitOnSelChange)
If true, the new value shall be committed as soon as a selection is made (commonly with the pointing device).
|
PdfChoiceFormField |
setEdit(boolean edit)
If true, the combo box shall include an editable text box as well as a
drop-down list; if false, it shall include only a drop-down list.
|
PdfChoiceFormField |
setIndices(PdfArray indices)
Sets the selected items in the field.
|
PdfChoiceFormField |
setListSelected(int[] optionNumbers)
Highlights the options.
|
PdfChoiceFormField |
setListSelected(String[] optionValues)
Highlights the options.
|
PdfChoiceFormField |
setListSelected(String[] optionValues,
boolean generateAppearance)
Highlights the options and generates field appearance if needed.
|
PdfChoiceFormField |
setMultiSelect(boolean multiSelect)
If true, more than one of the field's option items may be selected
simultaneously; if false, at most one item shall be selected.
|
PdfChoiceFormField |
setSort(boolean sort)
If true, the field's option items shall be sorted alphabetically.
|
PdfChoiceFormField |
setSpellCheck(boolean spellCheck)
If true, text entered in the field shall be spell-checked.
|
PdfChoiceFormField |
setTopIndex(int index)
Sets the index of the first visible option in a scrollable list.
|
addKid, addKid, addKid, getAdditionalAction, getAllChildFields, getAllChildFormFields, getAlternativeName, getAppearanceStates, getChildField, getChildFields, getChildFormAnnotations, getChildFormFields, getDefaultAppearance, getDefaultStyle, getDefaultValue, getDisplayValue, getFieldFlag, getFieldFlags, getFirstFormAnnotation, getFormFieldKeys, getFormType, getJustification, getKids, getMappingName, getOptions, getPartialFieldName, getRichText, getValue, getValueAsString, getWidgets, isFormField, isInReadingMode, isMultiline, isNoExport, isPassword, isReadOnly, isRequired, makeFieldFlag, makeFormField, makeFormFieldOrAnnotation, regenerateField, release, removeChild, removeChildren, setAdditionalAction, setAlternativeName, setCheckType, setColor, setDefaultStyle, setDefaultValue, setFieldFlag, setFieldFlag, setFieldFlags, setFieldName, setJustification, setMappingName, setNoExport, setOptions, setReadOnly, setRequired, setRichText, setValue, setValue, setValue, setValue, updateDefaultAppearancedisableCurrentFieldRegeneration, disableFieldRegeneration, enableCurrentFieldRegeneration, enableFieldRegeneration, equals, getColor, getDocument, getFieldName, getFont, getFontSize, getParent, getParentField, getPdfAConformanceLevel, getPdfObject, hashCode, isFieldRegenerationEnabled, isTerminalFormField, isWrappedObjectMustBeIndirect, put, remove, setFont, setFontAndSize, setFontSize, setFontSize, setFontSizeAutoScale, setParentensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidReleasepublic static final int FF_COMBO
public static final int FF_EDIT
public static final int FF_SORT
public static final int FF_MULTI_SELECT
public static final int FF_DO_NOT_SPELL_CHECK
public static final int FF_COMMIT_ON_SEL_CHANGE
protected PdfChoiceFormField(PdfDocument pdfDocument)
PdfChoiceFormField.pdfDocument - The PdfDocument instance.protected PdfChoiceFormField(PdfWidgetAnnotation widget, PdfDocument pdfDocument)
PdfWidgetAnnotation.widget - The widget which will be a kid of the PdfChoiceFormField.pdfDocument - The PdfDocument instance.protected PdfChoiceFormField(PdfDictionary pdfObject)
PdfDictionary.
This PdfDictionary must be an indirect object.pdfObject - the dictionary to be wrapped, must have an indirect reference.public PdfName getFormType()
Ch, the form type for choice form fields.getFormType in class PdfFormFieldPdfNamepublic PdfChoiceFormField setTopIndex(int index)
index - the index of the first optionPdfChoiceFormFieldpublic PdfNumber getTopIndex()
PdfNumberpublic PdfChoiceFormField setIndices(PdfArray indices)
indices - a sorted array of indices representing selected items in the fieldPdfChoiceFormFieldpublic PdfChoiceFormField setListSelected(String[] optionValues)
optionValues - Array of display values to be highlighted.PdfChoiceFormField.public PdfChoiceFormField setListSelected(String[] optionValues, boolean generateAppearance)
optionValues - Array of options to be highlightedgenerateAppearance - if false, appearance won't be regeneratedPdfChoiceFormFieldpublic PdfChoiceFormField setListSelected(int[] optionNumbers)
optionNumbers - The option numbersPdfChoiceFormFieldpublic PdfArray getIndices()
public PdfChoiceFormField setCombo(boolean combo)
combo - whether or not the field should be a combo boxPdfChoiceFormFieldpublic boolean isCombo()
public PdfChoiceFormField setEdit(boolean edit)
edit - whether or not to add an editable text boxPdfChoiceFormFieldpublic boolean isEdit()
public PdfChoiceFormField setSort(boolean sort)
sort - whether or not to sort the itemsPdfChoiceFormFieldpublic boolean isSort()
public PdfChoiceFormField setMultiSelect(boolean multiSelect)
multiSelect - whether or not to allow multiple selectionPdfChoiceFormFieldpublic boolean isMultiSelect()
public PdfChoiceFormField setSpellCheck(boolean spellCheck)
spellCheck - whether or not to require the PDF viewer to perform a spell checkPdfChoiceFormFieldpublic boolean isSpellCheck()
public PdfChoiceFormField setCommitOnSelChange(boolean commitOnSelChange)
commitOnSelChange - whether or not to save changes immediatelyPdfChoiceFormFieldpublic boolean isCommitOnSelChange()
Copyright © 1998–2024 Apryse Group NV. All rights reserved.