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

public abstract Class PDTerminalField

extends PDField
Class Inheritance
Known Direct Subclasses
org.apache.pdfbox.pdmodel.interactive.form.PDVariableText, org.apache.pdfbox.pdmodel.interactive.form.PDButton, org.apache.pdfbox.pdmodel.interactive.form.PDSignatureField
Imports
java.io.IOException, java.util.ArrayList, .List, org.apache.pdfbox.cos.COSArray, .COSBase, .COSDictionary, .COSInteger, .COSName, org.apache.pdfbox.pdmodel.fdf.FDFField, org.apache.pdfbox.pdmodel.interactive.action.PDFormFieldAdditionalActions, org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget

A field in an interactive form. Fields may be one of four types: button, text, choice, or signature.
Author
sug

Constructor Summary

AccessConstructor and Description
protected
PDTerminalField(PDAcroForm
The form that this field is part of.
acroForm
)

Constructor.

pack-priv
PDTerminalField(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
protected final void
applyChange()

Applies a value change to the field.

pack-priv abstract void
constructAppearances()

Constructs appearance streams and appearance dictionaries for all widget annotations.

pack-priv FDFField
exportFDF()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.exportFDF.

Exports this field and its children as FDF.

public int
getFieldFlags()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getFieldFlags.

This will get the flags for this field.

public String
getFieldType()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getFieldType.

Get the FT entry of the field.

public List<PDAnnotationWidget>

Returns:

The list of widget annotations. Be aware that this list is not backed by the actual widget collection of the field, so adding or deleting has no effect on the PDF document until you call setWidgets() with the modified list.
getWidgets
()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getWidgets.

Returns the widget annotations associated with this field.

public void
importFDF(FDFField
The fdf field to import.
fdfField
)

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDField.importFDF.

This will import a fdf field from a fdf document.

public void
setActions(PDFormFieldAdditionalActions
The field actions.
actions
)

Set the actions of the field.

public void
setWidgets(List<PDAnnotationWidget>
The list of widget annotations.
children
)

Sets the field's widget annotations.

Inherited from org.apache.pdfbox.pdmodel.interactive.form.PDField:
findKidfromDictionarygetAcroFormgetActionsgetAlternateFieldNamegetCOSObjectgetFullyQualifiedNamegetInheritableAttributegetMappingNamegetParentgetPartialNamegetValueAsStringisNoExportisReadOnlyisRequiredsetAlternateFieldNamesetFieldFlagssetMappingNamesetNoExportsetPartialNamesetReadOnlysetRequiredsetValuetoString

Constructor Detail

PDTerminalFieldback to summary
protected PDTerminalField(PDAcroForm acroForm)

Constructor.

Parameters
acroForm:PDAcroForm

The form that this field is part of.

PDTerminalFieldback to summary
pack-priv PDTerminalField(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

applyChangeback to summary
protected final void applyChange() throws IOException

Applies a value change to the field. Generates appearances if required and raises events.

Exceptions
IOException:
if the appearance couldn't be generated
constructAppearancesback to summary
pack-priv abstract void constructAppearances() throws IOException

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

Exceptions
IOException:
if the appearance couldn't be generated
exportFDFback to summary
pack-priv FDFField exportFDF() throws IOException

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.exportFDF.

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

Exports this field and its children as FDF.

Annotations
@Override
getFieldFlagsback to summary
public int getFieldFlags()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getFieldFlags.

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

This will get the flags for this field.

Returns:int

flags The set of flags.

Annotations
@Override
getFieldTypeback to summary
public String getFieldType()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getFieldType.

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

Get the FT entry of the field. This is a read only field and is set depending on the actual type. The field type is an inheritable attribute.

Returns:String

The Field type.

Annotations
@Override
getWidgetsback to summary
public List<PDAnnotationWidget> getWidgets()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getWidgets.

Returns the widget annotations associated with this field.

Returns:List<PDAnnotationWidget>

The list of widget annotations. Be aware that this list is not backed by the actual widget collection of the field, so adding or deleting has no effect on the PDF document until you call setWidgets() with the modified list.

Annotations
@Override
importFDFback to summary
public void importFDF(FDFField fdfField) throws IOException

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDField.importFDF.

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

This will import a fdf field from a fdf document.

Parameters
fdfField:FDFField

The fdf field to import.

Annotations
@Override
Exceptions
IOException:
If there is an error importing the data for this field.
setActionsback to summary
public void setActions(PDFormFieldAdditionalActions actions)

Set the actions of the field.

Parameters
actions:PDFormFieldAdditionalActions

The field actions.

setWidgetsback to summary
public void setWidgets(List<PDAnnotationWidget> children)

Sets the field's widget annotations.

Parameters
children:List<PDAnnotationWidget>

The list of widget annotations.