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
A signature field is a form field that contains a digital signature.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPDSignatureField(PDAcroForm acroForm) PDSignatureField(PDAcroForm acroForm, COSDictionary field, PDNonTerminalField parent) Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) voidConstructs appearance streams and appearance dictionaries for all widget annotations.private StringGenerate a unique name for the signature.Returns the default value, if any.(Optional; PDF 1.5) A seed value dictionary containing information that constrains the properties of a signature that is applied to the field.Get the signature dictionary.getValue()Returns the signature contained in this field.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.void(Optional; PDF 1.) A seed value dictionary containing information that constrains the properties of a signature that is applied to the field.voidsetSignature(PDSignature value) Deprecated.voidThis 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, getWidget, getWidgets, importFDF, setActions, setWidgetsMethods 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
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG
-
-
Constructor Details
-
PDSignatureField
- Parameters:
acroForm- The acroForm for this field.- Throws:
IOException- If there is an error while resolving partial name for the signature field or getting the widget object.- See Also:
-
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 Details
-
generatePartialName
Generate a unique name for the signature.- Returns:
- the signature's unique name
-
setSignature
Deprecated.UsesetValue(PDSignature)instead.Add a signature dictionary to the signature field.- Parameters:
value- is the PDSignatureField- Throws:
IOException
-
getSignature
Get the signature dictionary.- Returns:
- the signature dictionary
-
setValue
Sets the value of this field to be the given signature.- Parameters:
value- is the PDSignatureField- Throws:
IOException
-
setValue
This will throw an UnsupportedOperationException if used as the signature fields value can't be set using a String- Specified by:
setValuein classPDField- Parameters:
value- the plain text value.- Throws:
UnsupportedOperationException- in all cases!
-
setDefaultValue
Sets the default value of this field to be the given signature.- Parameters:
value- is the PDSignatureField- Throws:
IOException
-
getValue
Returns the signature contained in this field.- Returns:
- A signature dictionary.
-
getDefaultValue
Returns the default value, if any.- Returns:
- A signature dictionary.
-
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
(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
(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
Description 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:
IOException- if the appearance couldn't be generated
-
setValue(PDSignature)instead.