CheckboxField

Inheritance: java.lang.Object, com.aspose.pdf.BaseParagraph, com.aspose.pdf.Annotation, com.aspose.pdf.WidgetAnnotation, com.aspose.pdf.Field

public class CheckboxField extends Field

Class representing checkbox field

Constructors

ConstructorDescription
CheckboxField(Page page, Rectangle rect)Constructor for CheckboxField class.
CheckboxField(IDocument doc, Rectangle rect)Constructor for CheckboxField class.
CheckboxField()Create instance of CheckboxField.
CheckboxField(IDocument doc)Constructor to use with Generator.

Methods

MethodDescription
getAllowedStates()Returns list of allowed states.
getOnState()Returns name of state which is “Checked” state of checkbox.
getStyle()Gets style of check box.
setStyle(int value)Sets style of check box.
getActiveState()Gets current annotation appearance state.
setActiveState(String value)Sets current annotation appearance state.
getChecked()Gets state of check box.
setChecked(boolean value)Sets state of check box.
getNormalCaption()Gets normal caption of the field.
getValue()Gets value of check box field.
setValue(String value)Sets value of check box field.
deepClone()Clone the checkbox.
getExportValue()Gets or sets export value of CheckBox field.
setExportValue(String value)Gets or sets export value of CheckBox field.
addOption(String optionName)Adds new checkbox into a checkbox group, in which at most one of the checkboxes may be checked at any time.
addOption(String optionName, Rectangle rect)Adds new checkbox into a checkbox group, in which at most one of the checkboxes may be checked at any time.
addOption(String optionName, int page, Rectangle rect)Adds new checkbox into a checkbox group, in which at most one of the checkboxes may be checked at any time.

CheckboxField(Page page, Rectangle rect)

public CheckboxField(Page page, Rectangle rect)

Constructor for CheckboxField class.

Parameters:

ParameterTypeDescription
pagePagePage where check box will be placed.
rectRectanglePosition and size of the check box.

CheckboxField(IDocument doc, Rectangle rect)

public CheckboxField(IDocument doc, Rectangle rect)

Constructor for CheckboxField class.

Parameters:

ParameterTypeDescription
docIDocumentDocument where will be new field created.
rectRectangleRectangle where new field will be created.

CheckboxField()

public CheckboxField()

Create instance of CheckboxField.

CheckboxField(IDocument doc)

public CheckboxField(IDocument doc)

Constructor to use with Generator.

Parameters:

ParameterTypeDescription
docIDocumentDocument where field will be created.

getAllowedStates()

public List<String> getAllowedStates()

Returns list of allowed states.

Returns: java.util.List<java.lang.String> - list of String value

getOnState()

public String getOnState()

Returns name of state which is “Checked” state of checkbox. This is “Yes” if presents or any other value other then “Off” and “No”;

Returns: java.lang.String - String value

getStyle()

public int getStyle()

Gets style of check box.

Returns: int - style of check box.

setStyle(int value)

public void setStyle(int value)

Sets style of check box.

Parameters:

ParameterTypeDescription
valueintBoxStyle of check box.

getActiveState()

public String getActiveState()

Gets current annotation appearance state.

Returns: java.lang.String - String value

setActiveState(String value)

public void setActiveState(String value)

Sets current annotation appearance state.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

getChecked()

public boolean getChecked()

Gets state of check box.

Returns: boolean - boolean value

setChecked(boolean value)

public void setChecked(boolean value)

Sets state of check box.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getNormalCaption()

public String getNormalCaption()

Gets normal caption of the field.

Returns: java.lang.String - String value

getValue()

public String getValue()

Gets value of check box field.

Returns: java.lang.String - String value

setValue(String value)

public void setValue(String value)

Sets value of check box field.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

deepClone()

public Object deepClone()

Clone the checkbox.

Returns: java.lang.Object - The cloned object

getExportValue()

public final String getExportValue()

Gets or sets export value of CheckBox field.

Returns: java.lang.String - String value

setExportValue(String value)

public final void setExportValue(String value)

Gets or sets export value of CheckBox field.

Parameters:

ParameterTypeDescription
valuejava.lang.StringString value

addOption(String optionName)

public final void addOption(String optionName)

Adds new checkbox into a checkbox group, in which at most one of the checkboxes may be checked at any time. The new checkbox is added to the bottom of the group.

Parameters:

ParameterTypeDescription
optionNamejava.lang.StringValue of the option represented by added checkbox.

addOption(String optionName, Rectangle rect)

public final void addOption(String optionName, Rectangle rect)

Adds new checkbox into a checkbox group, in which at most one of the checkboxes may be checked at any time.

Parameters:

ParameterTypeDescription
optionNamejava.lang.StringValue of the option represented by added checkbox.
rectRectangleRectangle of the added checkbox.

addOption(String optionName, int page, Rectangle rect)

public final void addOption(String optionName, int page, Rectangle rect)

Adds new checkbox into a checkbox group, in which at most one of the checkboxes may be checked at any time.

Parameters:

ParameterTypeDescription
optionNamejava.lang.StringValue of the option represented by added checkbox.
pageintNumber of the page where the added checkbox should be placed.
rectRectangleRectangle of the added checkbox on the page.