Package com.itextpdf.forms.fields
Class PdfButtonFormField
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.forms.fields.PdfFormField
com.itextpdf.forms.fields.PdfButtonFormField
An interactive control on the screen that raises events and/or can retain data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intButton field flagsstatic final intstatic final intstatic final intFields inherited from class com.itextpdf.forms.fields.PdfFormField
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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPdfButtonFormField(PdfWidgetAnnotation widget, PdfDocument pdfDocument) protectedPdfButtonFormField(PdfDictionary pdfObject) protectedPdfButtonFormField(PdfDocument pdfDocument) -
Method Summary
Modifier and TypeMethodDescriptionReturnsBtn, the form type for choice form fields.booleanIf true, the field is a pushbutton that does not retain a permanent value.booleanisRadio()If true, the field is a set of radio buttons; if false, the field is a check box.booleanIf true, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked.booleanIf true, clicking the selected button deselects it, leaving no button selected.setImageAsForm(PdfFormXObject form) setPushButton(boolean pushButton) If true, the field is a pushbutton that does not retain a permanent value.setRadio(boolean radio) If true, the field is a set of radio buttons; if false, the field is a check box.setRadiosInUnison(boolean radiosInUnison) If true, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked.setToggleOff(boolean toggleOff) If true, clicking the selected button deselects it, leaving no button selected.Methods inherited from class com.itextpdf.forms.fields.PdfFormField
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, updateDefaultAppearanceMethods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
Field Details
-
FF_NO_TOGGLE_TO_OFF
public static final int FF_NO_TOGGLE_TO_OFFButton field flags -
FF_RADIO
public static final int FF_RADIO -
FF_PUSH_BUTTON
public static final int FF_PUSH_BUTTON -
FF_RADIOS_IN_UNISON
public static final int FF_RADIOS_IN_UNISON
-
-
Constructor Details
-
PdfButtonFormField
-
PdfButtonFormField
-
PdfButtonFormField
-
-
Method Details
-
getFormType
ReturnsBtn, the form type for choice form fields.- Overrides:
-
getFormTypein classPdfFormField - Returns:
-
the form type, as a
PdfName
-
isRadio
public boolean isRadio()If true, the field is a set of radio buttons; if false, the field is a check box. This flag only works if the Pushbutton flag is set to false.- Returns:
- whether the field is currently radio buttons or a checkbox
-
setRadio
If true, the field is a set of radio buttons; if false, the field is a check box. This flag should be set only if the Pushbutton flag is set to false.- Parameters:
-
radio- whether the field should be radio buttons or a checkbox - Returns:
-
current
PdfButtonFormField
-
isToggleOff
public boolean isToggleOff()If true, clicking the selected button deselects it, leaving no button selected. If false, exactly one radio button shall be selected at all times. Only valid for radio buttons.- Returns:
- whether a radio button currently allows to choose no options
-
setToggleOff
If true, clicking the selected button deselects it, leaving no button selected. If false, exactly one radio button shall be selected at all times.- Parameters:
-
toggleOff- whether a radio button may allow to choose no options - Returns:
-
current
PdfButtonFormField
-
isPushButton
public boolean isPushButton()If true, the field is a pushbutton that does not retain a permanent value.- Returns:
- whether or not the field is currently a pushbutton
-
setPushButton
If true, the field is a pushbutton that does not retain a permanent value.- Parameters:
-
pushButton- whether or not to set the field to a pushbutton - Returns:
-
current
PdfButtonFormField
-
isRadiosInUnison
public boolean isRadiosInUnison()If true, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If false, the buttons are mutually exclusive- Returns:
- whether or not buttons are turned off in unison
-
setRadiosInUnison
If true, a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If false, the buttons are mutually exclusive- Parameters:
-
radiosInUnison- whether or not buttons should turn off in unison - Returns:
-
current
PdfButtonFormField
-
setImage
- Throws:
-
IOException
-
setImageAsForm
-