Table of Contents

Class PdfButtonFormField

Namespace
iText.Forms.Fields
Assembly
itext.forms.dll

An interactive control on the screen that raises events and/or can retain data.

public class PdfButtonFormField : PdfFormField
Inheritance
PdfButtonFormField
Inherited Members

Constructors

PdfButtonFormField(PdfWidgetAnnotation, PdfDocument)

Creates a button form field as a parent of a PdfWidgetAnnotation.

protected PdfButtonFormField(PdfWidgetAnnotation widget, PdfDocument pdfDocument)

Parameters

widget PdfWidgetAnnotation

The widget which will be a kid of the PdfButtonFormField.

pdfDocument PdfDocument

The PdfDocument instance.

PdfButtonFormField(PdfDictionary)

Creates a button form field as a wrapper object around a PdfDictionary.

protected PdfButtonFormField(PdfDictionary pdfObject)

Parameters

pdfObject PdfDictionary

the dictionary to be wrapped, must have an indirect reference.

Remarks

Creates a button form field as a wrapper object around a PdfDictionary. This PdfDictionary must be an indirect object.

PdfButtonFormField(PdfDocument)

Creates a minimal PdfButtonFormField.

protected PdfButtonFormField(PdfDocument pdfDocument)

Parameters

pdfDocument PdfDocument

The PdfDocument instance.

Fields

FF_NO_TOGGLE_TO_OFF

If true, clicking the selected button deselects it, leaving no button selected.

public static readonly int FF_NO_TOGGLE_TO_OFF

Field Value

int

Remarks

If true, clicking the selected button deselects it, leaving no button selected. If false, exactly one radio button shall be selected at all times.

FF_PUSH_BUTTON

If true, the field is a push button that does not retain a permanent value.

public static readonly int FF_PUSH_BUTTON

Field Value

int

FF_RADIO

If true, the field is a set of radio buttons.

public static readonly int FF_RADIO

Field Value

int

Remarks

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 FF_PUSH_BUTTON flag is set to false.

FF_RADIOS_IN_UNISON

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.

public static readonly int FF_RADIOS_IN_UNISON

Field Value

int

Remarks

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.

Methods

AddKid(AbstractPdfFormField)

public override PdfFormField AddKid(AbstractPdfFormField kid)

Parameters

kid AbstractPdfFormField

Returns

PdfFormField

GetFormType()

Returns Btn, the form type for choice form fields.

public override PdfName GetFormType()

Returns

PdfName

the form type, as a PdfName

IsPushButton()

If true, the field is a pushbutton that does not retain a permanent value.

public virtual bool IsPushButton()

Returns

bool

whether or not the field is currently a pushbutton

IsRadio()

If true, the field is a set of radio buttons; if false, the field is a check box.

public virtual bool IsRadio()

Returns

bool

whether the field is currently radio buttons or a checkbox

Remarks

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.

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.

public virtual bool IsRadiosInUnison()

Returns

bool

whether or not buttons are turned off in unison

Remarks

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

IsToggleOff()

If true, clicking the selected button deselects it, leaving no button selected.

public virtual bool IsToggleOff()

Returns

bool

whether a radio button currently allows to choose no options

Remarks

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.

SetImage(string)

Set image to be used as a background content in a push button.

public virtual PdfButtonFormField SetImage(string image)

Parameters

image string

path to the image to be used.

Returns

PdfButtonFormField

this PdfButtonFormField

SetImageAsForm(PdfFormXObject)

Set image to be used as a background content in a push button as PdfFormXObject.

public virtual PdfButtonFormField SetImageAsForm(PdfFormXObject form)

Parameters

form PdfFormXObject

PdfFormXObject to be used as an image

Returns

PdfButtonFormField

this PdfButtonFormField

SetPushButton(bool)

If true, the field is a pushbutton that does not retain a permanent value.

public virtual PdfButtonFormField SetPushButton(bool pushButton)

Parameters

pushButton bool

whether or not to set the field to a pushbutton

Returns

PdfButtonFormField

current PdfButtonFormField

SetRadio(bool)

If true, the field is a set of radio buttons; if false, the field is a check box.

public virtual PdfButtonFormField SetRadio(bool radio)

Parameters

radio bool

whether the field should be radio buttons or a checkbox

Returns

PdfButtonFormField

current PdfButtonFormField

Remarks

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.

SetRadiosInUnison(bool)

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.

public virtual PdfButtonFormField SetRadiosInUnison(bool radiosInUnison)

Parameters

radiosInUnison bool

whether or not buttons should turn off in unison

Returns

PdfButtonFormField

current PdfButtonFormField

Remarks

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

SetToggleOff(bool)

If true, clicking the selected button deselects it, leaving no button selected.

public virtual PdfButtonFormField SetToggleOff(bool toggleOff)

Parameters

toggleOff bool

whether a radio button may allow to choose no options

Returns

PdfButtonFormField

current PdfButtonFormField

Remarks

If true, clicking the selected button deselects it, leaving no button selected. If false, exactly one radio button shall be selected at all times.