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

public Class PDSignatureField

extends PDTerminalField
Class Inheritance
Imports
java.io.IOException, java.util.HashSet, .Set, org.apache.commons.logging.Log, .LogFactory, org.apache.pdfbox.cos.COSDictionary, .COSName, org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget, org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSeedValue, .PDSignature

A signature field is a form field that contains a digital signature.
Authors
Ben Litchfield, Thomas Chojecki

Field Summary

Modifier and TypeField and Description
private static final Log

Constructor Summary

AccessConstructor and Description
public
PDSignatureField(PDAcroForm
The acroForm for this field.
acroForm
)

pack-priv
PDSignatureField(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 to be created
parent
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
constructAppearances()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.constructAppearances.

Constructs appearance streams and appearance dictionaries for all widget annotations.

private String

Returns:

the signature's unique name
generatePartialName
()

Generate a unique name for the signature.

public PDSignature

Returns:

A signature dictionary.
getDefaultValue
()

Returns the default value, if any.

public PDSeedValue

Returns:

the seed value dictionary as PDSeedValue
getSeedValue
()

(Optional; PDF 1.5) A seed value dictionary containing information that constrains the properties of a signature that is applied to the field.

public PDSignature

Returns:

the signature dictionary
getSignature
()

Get the signature dictionary.

public PDSignature

Returns:

A signature dictionary.
getValue
()

Returns the signature contained in this field.

public String
getValueAsString()

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

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

public void
setDefaultValue(PDSignature
is the PDSignatureField
value
)

Sets the default value of this field to be the given signature.

public void
setSeedValue(PDSeedValue
is the seed value dictionary as PDSeedValue
sv
)

(Optional; PDF 1.) A seed value dictionary containing information that constrains the properties of a signature that is applied to the field.

public void
setValue(PDSignature
is the PDSignatureField
value
)

Sets the value of this field to be the given signature.

public void
setValue(String
the plain text value.
value
)

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

This will throw an UnsupportedOperationException if used as the signature fields value can't be set using a String

Inherited from org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField:
applyChangeexportFDFgetFieldFlagsgetFieldTypegetWidgetsimportFDFsetActionssetWidgets

Field Detail

LOGback to summary
private static final Log LOG

Constructor Detail

PDSignatureFieldback to summary
public PDSignatureField(PDAcroForm acroForm)
Parameters
acroForm:PDAcroForm

The acroForm for this field.

See Also
PDTerminalField#PDTerminalField(PDAcroForm)
PDSignatureFieldback to summary
pack-priv PDSignatureField(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 to be created

Method Detail

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

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.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
generatePartialNameback to summary
private String generatePartialName()

Generate a unique name for the signature.

Returns:String

the signature's unique name

getDefaultValueback to summary
public PDSignature getDefaultValue()

Returns the default value, if any.

Returns:PDSignature

A signature dictionary.

getSeedValueback to summary
public PDSeedValue getSeedValue()

(Optional; PDF 1.5) A seed value dictionary containing information that constrains the properties of a signature that is applied to the field.

Returns:PDSeedValue

the seed value dictionary as PDSeedValue

getSignatureback to summary
public PDSignature getSignature()

Get the signature dictionary.

Returns:PDSignature

the signature dictionary

getValueback to summary
public PDSignature getValue()

Returns the signature contained in this field.

Returns:PDSignature

A signature dictionary.

getValueAsStringback to summary
public String getValueAsString()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.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
setDefaultValueback to summary
public void setDefaultValue(PDSignature value)

Sets the default value of this field to be the given signature.

Parameters
value:PDSignature

is the PDSignatureField

setSeedValueback to summary
public void setSeedValue(PDSeedValue sv)

(Optional; PDF 1.) A seed value dictionary containing information that constrains the properties of a signature that is applied to the field.

Parameters
sv:PDSeedValue

is the seed value dictionary as PDSeedValue

setValueback to summary
public void setValue(PDSignature value) throws IOException

Sets the value of this field to be the given signature.

Parameters
value:PDSignature

is the PDSignatureField

Exceptions
IOException:
if the new value could not be applied
setValueback to summary
public void setValue(String value)

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

This will throw an UnsupportedOperationException if used as the signature fields value can't be set using a String

Parameters
value:String

the plain text value.

Annotations
@Override
Exceptions
UnsupportedOperationException:
in all cases!