public class PdfChoiceFormField extends PdfFormField
Modifier and Type | Field and Description |
---|---|
static int |
FF_COMBO
Choice field flags
|
static int |
FF_COMMIT_ON_SEL_CHANGE |
static int |
FF_DO_NOT_SPELL_CHECK |
static int |
FF_EDIT |
static int |
FF_MULTI_SELECT |
static int |
FF_SORT |
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, backgroundColor, borderColor, borderWidth, checkType, color, FF_MULTILINE, FF_NO_EXPORT, FF_PASSWORD, FF_READ_ONLY, FF_REQUIRED, font, fontSize, form, HIDDEN, HIDDEN_BUT_PRINTABLE, img, pdfAConformanceLevel, rotation, text, TYPE_CHECK, TYPE_CIRCLE, TYPE_CROSS, TYPE_DIAMOND, TYPE_SQUARE, TYPE_STAR, VISIBLE, VISIBLE_BUT_DOES_NOT_PRINT
Modifier | Constructor and Description |
---|---|
protected |
PdfChoiceFormField(PdfDictionary pdfObject) |
protected |
PdfChoiceFormField(PdfDocument pdfDocument) |
protected |
PdfChoiceFormField(PdfWidgetAnnotation widget, PdfDocument pdfDocument) |
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, createButton, createButton, createButton, createButton, createCheckBox, createCheckBox, createCheckBox, createChoice, createChoice, createChoice, createChoice, createChoice, createChoice, createChoice, createComboBox, createComboBox, createComboBox, createComboBox, createEmptyField, createEmptyField, createList, createList, createList, createList, createMultilineText, createMultilineText, createPushButton, createPushButton, createPushButton, createRadioButton, createRadioButton, createRadioGroup, createRadioGroup, createSignature, createSignature, createSignature, createSignature, createText, createText, createText, createText, createText, createText, createText, createText, drawBorder, drawButton, drawCheckAppearance, drawCheckBox, drawMultiLineTextAppearance, drawPdfA2CheckAppearance, drawPdfACheckBox, drawPushButtonAppearance, drawRadioAppearance, drawRadioBorder, drawRadioField, drawTextAppearance, getAdditionalAction, getAlternativeName, getAppearanceStates, getBorderWidth, getColor, getDefaultAppearance, getDefaultStyle, getDefaultValue, getDocument, getFieldFlag, getFieldFlags, getFieldName, getFont, getFontSize, getJustification, getKids, getMappingName, getOptions, getParent, getRect, getRichText, getValue, getValueAsString, getWidgets, isMultiline, isNoExport, isPassword, isReadOnly, isRequired, isWrappedObjectMustBeIndirect, makeFieldFlag, makeFormField, processOptions, processOptions, put, regenerateField, release, remove, setAction, setAdditionalAction, setAlternativeName, setAppearance, setBackgroundColor, setBorderColor, setBorderStyle, setBorderWidth, setCheckType, setColor, setDefaultStyle, setDefaultValue, setFieldFlag, setFieldFlag, setFieldFlags, setFieldName, setFont, setFontAndSize, setFontSize, setFontSize, setFontSizeAutoScale, setJustification, setMappingName, setNoExport, setOptions, setPage, setParent, setReadOnly, setRequired, setRichText, setRotation, setValue, setValue, setValue, setValue, setVisibility, splitDAelements, updateDefaultAppearance
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
public 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)
protected PdfChoiceFormField(PdfWidgetAnnotation widget, PdfDocument pdfDocument)
protected PdfChoiceFormField(PdfDictionary pdfObject)
public PdfName getFormType()
Ch
, the form type for choice form fields.
getFormType
in class PdfFormField
PdfName
public PdfChoiceFormField setTopIndex(int index)
index
- the index of the first option
PdfChoiceFormField
public PdfNumber getTopIndex()
PdfNumber
public PdfChoiceFormField setIndices(PdfArray indices)
indices
- a sorted array of indices representing selected items in the field
PdfChoiceFormField
public PdfChoiceFormField setListSelected(String[] optionValues)
optionValues
- Array of options to be highlighted
PdfChoiceFormField
public PdfChoiceFormField setListSelected(String[] optionValues, boolean generateAppearance)
optionValues
- Array of options to be highlighted
generateAppearance
- if false, appearance won't be regenerated
PdfChoiceFormField
public PdfChoiceFormField setListSelected(int[] optionNumbers)
optionNumbers
- The option numbers
PdfChoiceFormField
public PdfArray getIndices()
public PdfChoiceFormField setCombo(boolean combo)
combo
- whether or not the field should be a combo box
PdfChoiceFormField
public boolean isCombo()
public PdfChoiceFormField setEdit(boolean edit)
edit
- whether or not to add an editable text box
PdfChoiceFormField
public boolean isEdit()
public PdfChoiceFormField setSort(boolean sort)
sort
- whether or not to sort the items
PdfChoiceFormField
public boolean isSort()
public PdfChoiceFormField setMultiSelect(boolean multiSelect)
multiSelect
- whether or not to allow multiple selection
PdfChoiceFormField
public boolean isMultiSelect()
public PdfChoiceFormField setSpellCheck(boolean spellCheck)
spellCheck
- whether or not to require the PDF viewer to perform a spell check
PdfChoiceFormField
public boolean isSpellCheck()
public PdfChoiceFormField setCommitOnSelChange(boolean commitOnSelChange)
commitOnSelChange
- whether or not to save changes immediately
PdfChoiceFormField
public boolean isCommitOnSelChange()
Copyright © 1998–2022 iText Group NV. All rights reserved.