Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.interactive.form

public final Class PDCheckBox

extends PDButton
Class Inheritance
Imports
java.io.IOException, java.util.Set, org.apache.pdfbox.cos.COSDictionary, .COSName, org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget, .PDAppearanceDictionary, .PDAppearanceEntry

A check box toggles between two states, on and off.
Authors
Ben Litchfield, sug

Field Summary

Inherited from org.apache.pdfbox.pdmodel.interactive.form.PDButton:
FLAG_PUSHBUTTONFLAG_RADIOFLAG_RADIOS_IN_UNISON

Constructor Summary

AccessConstructor and Description
public
PDCheckBox(PDAcroForm
The acroform.
acroForm
)

pack-priv
PDCheckBox(PDAcroForm
The form that this field is part of.
acroForm
,
COSDictionary
the PDF object to represent as a field.
field
,
PDNonTerminalField
the parent node of the node
parent
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
check()

Checks the check box.

public String

Returns:

the value setting the check box to the On state. If an empty string is returned there is no appearance definition.
getOnValue
()

Get the value which sets the check box to the On state.

public boolean

Returns:

true If this field is checked.
isChecked
()

This will tell if this radio button is currently checked or not.

public void
unCheck()

Unchecks the check box.

Inherited from org.apache.pdfbox.pdmodel.interactive.form.PDButton:
checkValueconstructAppearancesgetDefaultValuegetExportValuesgetOnValuesgetValuegetValueAsStringisPushButtonisRadioButtonsetDefaultValuesetExportValuessetValuesetValue

Constructor Detail

PDCheckBoxback to summary
public PDCheckBox(PDAcroForm acroForm)
Parameters
acroForm:PDAcroForm

The acroform.

See Also
PDField#PDField(PDAcroForm)
PDCheckBoxback to summary
pack-priv PDCheckBox(PDAcroForm acroForm, COSDictionary field, PDNonTerminalField parent)

Constructor.

Parameters
acroForm:PDAcroForm

The form that this field is part of.

field:COSDictionary

the PDF object to represent as a field.

parent:PDNonTerminalField

the parent node of the node

Method Detail

checkback to summary
public void check() throws IOException

Checks the check box.

Exceptions
IOException:
if the appearance couldn't be generated.
getOnValueback to summary
public String getOnValue()

Get the value which sets the check box to the On state.

The On value should be 'Yes' but other values are possible so we need to look for that. On the other hand the Off value shall always be 'Off'. If not set or not part of the normal appearance keys 'Off' is the default

Returns:String

the value setting the check box to the On state. If an empty string is returned there is no appearance definition.

isCheckedback to summary
public boolean isChecked()

This will tell if this radio button is currently checked or not. This is equivalent to calling getValue().

Returns:boolean

true If this field is checked.

unCheckback to summary
public void unCheck() throws IOException

Unchecks the check box.

Exceptions
IOException:
if the appearance couldn't be generated.