Package com.itextpdf.forms.fields
Class PdfSignatureFormField
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
-
- com.itextpdf.forms.fields.AbstractPdfFormField
-
- com.itextpdf.forms.fields.PdfFormField
-
- com.itextpdf.forms.fields.PdfSignatureFormField
-
public class PdfSignatureFormField extends PdfFormField
An AcroForm field containing signature data.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
ignorePageRotation
Indicates if we need to ignore page rotation for the signature field annotation.private PdfFormXObject
n0
Background level of the signature appearance.private PdfFormXObject
n2
Signature appearance layer that contains information about the signature.private boolean
reuseAppearance
Indicates if we need to reuse the existing appearance as a background layer.-
Fields inherited from class com.itextpdf.forms.fields.PdfFormField
checkType, FF_MULTILINE, FF_NO_EXPORT, FF_PASSWORD, FF_READ_ONLY, FF_REQUIRED, form, img, text
-
Fields inherited from class com.itextpdf.forms.fields.AbstractPdfFormField
color, DEFAULT_FONT_SIZE, font, fontSize, MIN_FONT_SIZE, parent, pdfConformance
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PdfSignatureFormField(PdfWidgetAnnotation widget, PdfDocument pdfDocument)
Creates a signature form field as a parent of aPdfWidgetAnnotation
.protected
PdfSignatureFormField(PdfDictionary pdfObject)
Creates a signature form field as a wrapper object around aPdfDictionary
.protected
PdfSignatureFormField(PdfDocument pdfDocument)
Creates a minimalPdfSignatureFormField
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) PdfFormXObject
getBackgroundLayer()
Gets the background layer that is present when creating the signature field if it was set.PdfName
getFormType()
ReturnsSig
, the form type for signature form fields.PdfSigFieldLock
getSigFieldLockDictionary()
Gets thePdfSigFieldLock
, which contains fields that must be locked if the document is signed.(package private) PdfFormXObject
getSignatureAppearanceLayer()
Gets the signature appearance layer that contains information about the signature if it was set.(package private) boolean
isPageRotationIgnored()
Indicates if page rotation should be ignored for the signature appearance.(package private) boolean
isReuseAppearance()
Indicates if the existing appearances needs to be reused as a background.PdfSignatureFormField
setBackgroundLayer(PdfFormXObject n0)
Sets the background layer that is present when creating the signature field.PdfSignatureFormField
setIgnorePageRotation(boolean ignore)
Sets the boolean value which indicates if page rotation should be ignored for the signature appearance.PdfSignatureFormField
setReuseAppearance(boolean reuseAppearance)
Indicates that the existing appearances needs to be reused as a background.PdfSignatureFormField
setSignatureAppearanceLayer(PdfFormXObject n2)
Sets the signature appearance layer that contains information about the signature, e.g.PdfSignatureFormField
setValue(PdfObject value)
Adds the signature to the signature field.-
Methods inherited from class com.itextpdf.forms.fields.PdfFormField
addKid, addKid, addKid, applyAccessibilityProperties, getAdditionalAction, getAllChildFields, getAllChildFormFields, getAlternativeName, getAppearanceStates, getChildField, getChildFields, getChildFormAnnotations, getChildFormFields, getDefaultAppearance, getDefaultStyle, getDefaultValue, getDisplayValue, getFieldFlag, getFieldFlags, getFirstFormAnnotation, getFormFieldKeys, getFormType, getJustification, getKids, getMappingName, getOptions, getPartialFieldName, getRichText, getStringValue, getValue, getValueAsString, getWidgets, isFormField, isInReadingMode, isMultiline, isNoExport, isPassword, isReadOnly, isRequired, makeFieldFlag, makeFormField, makeFormFieldOrAnnotation, optionsArrayToString, regenerateField, release, removeChild, removeChildren, replaceKids, setAdditionalAction, setAlternativeName, setCheckType, setChildField, setColor, setDefaultStyle, setDefaultValue, setFieldFlag, setFieldFlag, setFieldFlags, setFieldName, setJustification, setMappingName, setNoExport, setOptions, setReadOnly, setRequired, setRichText, setValue, setValue, setValue, setValue, updateDefaultAppearance, updateFontAndFontSize
-
Methods inherited from class com.itextpdf.forms.fields.AbstractPdfFormField
disableCurrentFieldRegeneration, disableFieldRegeneration, enableCurrentFieldRegeneration, enableFieldRegeneration, equals, getAcroFormObject, getColor, getDocument, getFieldName, getFieldName, getFont, getFontSize, getParent, getParentField, getPdfConformance, getPdfObject, hashCode, isFieldRegenerationEnabled, isTerminalFormField, isWrappedObjectMustBeIndirect, put, remove, retrieveStyles, setColorNoRegenerate, setFont, setFontAndSize, setFontSize, setFontSize, setFontSizeAutoScale, setParent
-
Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
-
-
-
Field Detail
-
reuseAppearance
private boolean reuseAppearance
Indicates if we need to reuse the existing appearance as a background layer.
-
ignorePageRotation
private boolean ignorePageRotation
Indicates if we need to ignore page rotation for the signature field annotation.
-
n0
private PdfFormXObject n0
Background level of the signature appearance.
-
n2
private PdfFormXObject n2
Signature appearance layer that contains information about the signature.
-
-
Constructor Detail
-
PdfSignatureFormField
protected PdfSignatureFormField(PdfDocument pdfDocument)
Creates a minimalPdfSignatureFormField
.- Parameters:
pdfDocument
- ThePdfDocument
instance.
-
PdfSignatureFormField
protected PdfSignatureFormField(PdfWidgetAnnotation widget, PdfDocument pdfDocument)
Creates a signature form field as a parent of aPdfWidgetAnnotation
.- Parameters:
widget
- The widget which will be a kid of thePdfSignatureFormField
.pdfDocument
- ThePdfDocument
instance.
-
PdfSignatureFormField
protected PdfSignatureFormField(PdfDictionary pdfObject)
Creates a signature form field as a wrapper object around aPdfDictionary
. ThisPdfDictionary
must be an indirect object.- Parameters:
pdfObject
- the dictionary to be wrapped, must have an indirect reference.
-
-
Method Detail
-
getFormType
public PdfName getFormType()
ReturnsSig
, the form type for signature form fields.- Overrides:
getFormType
in classPdfFormField
- Returns:
- the form type, as a
PdfName
-
setValue
public PdfSignatureFormField setValue(PdfObject value)
Adds the signature to the signature field.- Parameters:
value
- the signature to be contained in the signature field, or an indirect reference to it- Returns:
- the edited field
-
getSigFieldLockDictionary
public PdfSigFieldLock getSigFieldLockDictionary()
Gets thePdfSigFieldLock
, which contains fields that must be locked if the document is signed.- Returns:
- a dictionary containing locked fields.
- See Also:
PdfSigFieldLock
-
setBackgroundLayer
public PdfSignatureFormField setBackgroundLayer(PdfFormXObject n0)
Sets the background layer that is present when creating the signature field.- Parameters:
n0
- layer xObject.- Returns:
- this same
PdfSignatureFormField
instance.
-
setSignatureAppearanceLayer
public PdfSignatureFormField setSignatureAppearanceLayer(PdfFormXObject n2)
Sets the signature appearance layer that contains information about the signature, e.g. the line art for the handwritten signature, the text giving the signer’s name, date, reason, location and so on.- Parameters:
n2
- layer xObject.- Returns:
- this same
PdfSignatureFormField
instance.
-
setReuseAppearance
public PdfSignatureFormField setReuseAppearance(boolean reuseAppearance)
Indicates that the existing appearances needs to be reused as a background.- Parameters:
reuseAppearance
- is an appearances reusing flag value to set.- Returns:
- this same
PdfSignatureFormField
instance.
-
setIgnorePageRotation
public PdfSignatureFormField setIgnorePageRotation(boolean ignore)
Sets the boolean value which indicates if page rotation should be ignored for the signature appearance.Default value is
true
.- Parameters:
ignore
- boolean value to set.- Returns:
- this same
PdfSignatureFormField
instance.
-
getBackgroundLayer
PdfFormXObject getBackgroundLayer()
Gets the background layer that is present when creating the signature field if it was set.- Returns:
- n0 layer xObject.
-
getSignatureAppearanceLayer
PdfFormXObject getSignatureAppearanceLayer()
Gets the signature appearance layer that contains information about the signature if it was set.- Returns:
- n2 layer xObject.
-
isReuseAppearance
boolean isReuseAppearance()
Indicates if the existing appearances needs to be reused as a background.- Returns:
- appearances reusing flag value.
-
isPageRotationIgnored
boolean isPageRotationIgnored()
Indicates if page rotation should be ignored for the signature appearance.- Returns:
- the boolean value which indicates if we need to ignore page rotation for the signature appearance.
-
-