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

public Class PDPushButton

extends PDButton
Class Inheritance
Imports
java.io.IOException, java.util.Collections, .List, .Set, org.apache.pdfbox.cos.COSDictionary, .COSName

A pushbutton is a purely interactive control that responds immediately to user input without retaining a permanent value.
Author
sug

Field Summary

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

Constructor Summary

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

pack-priv
PDPushButton(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
pack-priv void
constructAppearances()

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.constructAppearances.

Constructs appearance streams and appearance dictionaries for all widget annotations.

public String
public List<String>
getExportValues()

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.getExportValues.

This will get the (optional) export values.

public Set<String>
getOnValues()

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.getOnValues.

Get the values to set individual buttons within a group to the on state.

public String
public String
getValueAsString()

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.getValueAsString.

Returns a string representation of the "V" entry, or an empty string.

public void
setExportValues(List<String>
List containing all possible export values. Supplying null or an empty list will remove the Opt entry.
values
)

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.setExportValues.

This will set the export values.

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

Constructor Detail

PDPushButtonback to summary
public PDPushButton(PDAcroForm acroForm)
Parameters
acroForm:PDAcroForm

The acroform.

See Also
PDField#PDField(PDAcroForm)
PDPushButtonback to summary
pack-priv PDPushButton(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

constructAppearancesback to summary
pack-priv void constructAppearances() throws IOException

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.constructAppearances.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.constructAppearances.

Constructs appearance streams and appearance dictionaries for all widget annotations. Subclasses should not call this method directly but via applyChange().

Annotations
@Override
Exceptions
IOException:
if the appearance couldn't be generated
getDefaultValueback to summary
public String getDefaultValue()

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.getDefaultValue.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDButton.getDefaultValue.

Returns the default value, if any.

Returns:String

A non-null string.

Annotations
@Override
getExportValuesback to summary
public List<String> getExportValues()

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.getExportValues.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDButton.getExportValues.

This will get the (optional) export values.

The export values are defined in the field dictionaries /Opt key.

The option values are used to define the export values for the field to

  • hold values in non-Latin writing systems as name objects, which represent the field value, are limited to PDFDocEncoding
  • allow radio buttons having the same export value to be handled independently
Returns:List<String>

List containing all possible export values. If there is no /Opt entry an empty list will be returned.

Annotations
@Override
getOnValuesback to summary
public Set<String> getOnValues()

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.getOnValues.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDButton.getOnValues.

Get the values to set individual buttons within a group to the on state.

The On value could be an arbitrary string as long as it is within the limitations of a PDF name object. The Off value shall always be 'Off'. If not set or not part of the normal appearance keys 'Off' is the default

Returns:Set<String>

the potential values setting the check box to the On state. If an empty Set is returned there is no appearance definition.

Annotations
@Override
getValueback to summary
public String getValue()

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.getValue.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDButton.getValue.

Returns the selected value.

Off is the default value which will also be returned if the value hasn't been set at all.

Returns:String

A non-null string.

Annotations
@Override
getValueAsStringback to summary
public String getValueAsString()

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.getValueAsString.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDField.getValueAsString.

Returns a string representation of the "V" entry, or an empty string.

Returns:String

The list of widget annotations.

Annotations
@Override
setExportValuesback to summary
public void setExportValues(List<String> values)

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDButton.setExportValues.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDButton.setExportValues.

This will set the export values.

Parameters
values:List<String>

List containing all possible export values. Supplying null or an empty list will remove the Opt entry.

Annotations
@Override