Class PDSignatureField
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.interactive.form.PDField
-
- org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField
-
- org.apache.pdfbox.pdmodel.interactive.form.PDSignatureField
-
- All Implemented Interfaces:
COSObjectable
public class PDSignatureField extends PDTerminalField
A signature field is a form field that contains a digital signature.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.commons.logging.LogLOG
-
Constructor Summary
Constructors Constructor Description PDSignatureField(PDAcroForm acroForm)PDSignatureField(PDAcroForm acroForm, COSDictionary field, PDNonTerminalField parent)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidconstructAppearances()Constructs appearance streams and appearance dictionaries for all widget annotations.private java.lang.StringgeneratePartialName()Generate a unique name for the signature.PDSignaturegetDefaultValue()Returns the default value, if any.PDSeedValuegetSeedValue()(Optional; PDF 1.5) A seed value dictionary containing information that constrains the properties of a signature that is applied to the field.PDSignaturegetSignature()Get the signature dictionary.PDSignaturegetValue()Returns the signature contained in this field.java.lang.StringgetValueAsString()Returns a string representation of the "V" entry, or an empty string.voidsetDefaultValue(PDSignature value)Sets the default value of this field to be the given signature.voidsetSeedValue(PDSeedValue sv)(Optional; PDF 1.) A seed value dictionary containing information that constrains the properties of a signature that is applied to the field.voidsetValue(java.lang.String value)This will throw an UnsupportedOperationException if used as the signature fields value can't be set using a StringvoidsetValue(PDSignature value)Sets the value of this field to be the given signature.-
Methods inherited from class org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField
applyChange, exportFDF, getFieldFlags, getFieldType, getWidgets, importFDF, setActions, setWidgets
-
Methods inherited from class org.apache.pdfbox.pdmodel.interactive.form.PDField
findKid, fromDictionary, getAcroForm, getActions, getAlternateFieldName, getCOSObject, getFullyQualifiedName, getInheritableAttribute, getMappingName, getParent, getPartialName, isNoExport, isReadOnly, isRequired, setAlternateFieldName, setFieldFlags, setMappingName, setNoExport, setPartialName, setReadOnly, setRequired, toString
-
-
-
-
Constructor Detail
-
PDSignatureField
public PDSignatureField(PDAcroForm acroForm)
- Parameters:
acroForm- The acroForm for this field.- See Also:
PDTerminalField(PDAcroForm)
-
PDSignatureField
PDSignatureField(PDAcroForm acroForm, COSDictionary field, PDNonTerminalField parent)
Constructor.- Parameters:
acroForm- The form that this field is part of.field- the PDF object to represent as a field.parent- the parent node of the node to be created
-
-
Method Detail
-
generatePartialName
private java.lang.String generatePartialName()
Generate a unique name for the signature.- Returns:
- the signature's unique name
-
getSignature
public PDSignature getSignature()
Get the signature dictionary.- Returns:
- the signature dictionary
-
setValue
public void setValue(PDSignature value) throws java.io.IOException
Sets the value of this field to be the given signature.- Parameters:
value- is the PDSignatureField- Throws:
java.io.IOException- if the new value could not be applied
-
setValue
public void setValue(java.lang.String value)
This will throw an UnsupportedOperationException if used as the signature fields value can't be set using a String
-
setDefaultValue
public void setDefaultValue(PDSignature value)
Sets the default value of this field to be the given signature.- Parameters:
value- is the PDSignatureField
-
getValue
public PDSignature getValue()
Returns the signature contained in this field.- Returns:
- A signature dictionary.
-
getDefaultValue
public PDSignature getDefaultValue()
Returns the default value, if any.- Returns:
- A signature dictionary.
-
getValueAsString
public java.lang.String getValueAsString()
Description copied from class:PDFieldReturns a string representation of the "V" entry, or an empty string.- Specified by:
getValueAsStringin classPDField- Returns:
- The list of widget annotations.
-
getSeedValue
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:
- the seed value dictionary as PDSeedValue
-
setSeedValue
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- is the seed value dictionary as PDSeedValue
-
constructAppearances
void constructAppearances() throws java.io.IOExceptionDescription copied from class:PDTerminalFieldConstructs appearance streams and appearance dictionaries for all widget annotations. Subclasses should not call this method directly but viaPDTerminalField.applyChange().- Specified by:
constructAppearancesin classPDTerminalField- Throws:
java.io.IOException- if the appearance couldn't be generated
-
-