Class SignerProperties
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
This string could be used to create theSignatureFieldAppearance
instance which will be used for signing since its ID will be ignored anyway in that case, and specified ID won't override the field name. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the document's certification level.Gets the signature date.Returns the signing contact.Getter for the field lock dictionary.Gets the field name.Returns the signing location.int
Provides the page number of the signature field which this signature appearance is associated with.Provides the rectangle that represent the position and dimension of the signature field in the page.Returns the signing reason.Gets signature field appearance object representing the appearance of the signature.Returns the signature creator.setCertificationLevel
(AccessPermissions accessPermissions) Sets the document's certification level.setClaimedSignDate
(Calendar signDate) Sets the signature date.setContact
(String contact) Sets the signing contact.setFieldLockDict
(PdfSigFieldLock fieldLock) Setter for the field lock dictionary.setFieldName
(String fieldName) Sets the name indicating the field to be signed.setLocation
(String location) Sets the signing location.setPageNumber
(int pageNumber) Sets the page number of the signature field which this signature appearance is associated with.setPageRect
(Rectangle pageRect) Sets the rectangle that represent the position and dimension of the signature field in the page.Sets the signing reason.setSignatureAppearance
(SignatureFieldAppearance appearance) Sets the signature field layout element to customize the appearance of the signature.setSignatureCreator
(String signatureCreator) Sets the name of the application used to create the signature.
-
Field Details
-
IGNORED_ID
This string could be used to create theSignatureFieldAppearance
instance which will be used for signing since its ID will be ignored anyway in that case, and specified ID won't override the field name.
-
-
Constructor Details
-
SignerProperties
public SignerProperties()Create instance ofSignerProperties
.
-
-
Method Details
-
getClaimedSignDate
Gets the signature date.- Returns:
- calendar set to the signature date
-
setClaimedSignDate
Sets the signature date.- Parameters:
-
signDate
- the signature date - Returns:
- this instance to support fluent interface
-
setSignatureAppearance
Sets the signature field layout element to customize the appearance of the signature. ID specified forSignatureFieldAppearance
will be ignored and won't override field name, soIGNORED_ID
could be used. To specify signature name usesetFieldName(java.lang.String)
.Note that if
SignedAppearanceText
was set as the content (or part of the content) forSignatureFieldAppearance
object,PdfSigner
properties such as signing date, reason, location and signer name could be set automatically.In case you create new signature field (either using
setFieldName(java.lang.String)
with the name that doesn't exist in the document or do not specifying it at all) then the signature is invisible by default. UsesetPageRect(Rectangle)
andsetPageNumber(int)
to provide the rectangle that represent the position and dimension of the signature field in the specified page.It is possible to set other appearance related properties such as
PdfSignatureFormField.setReuseAppearance(boolean)
,PdfSignatureFormField.setBackgroundLayer(com.itextpdf.kernel.pdf.xobject.PdfFormXObject)
(n0 layer) andPdfSignatureFormField.setSignatureAppearanceLayer(com.itextpdf.kernel.pdf.xobject.PdfFormXObject)
(n2 layer) for the signature field usingPdfSigner.getSignatureField()
. Page, rectangle and other properties could be also set up viaSignerProperties
.- Parameters:
-
appearance
- theSignatureFieldAppearance
layout element representing signature appearance - Returns:
- this instance to support fluent interface
-
getSignatureAppearance
Gets signature field appearance object representing the appearance of the signature.To customize the signature appearance, create new
SignatureFieldAppearance
object and set it usingsetSignatureAppearance(SignatureFieldAppearance)
.- Returns:
-
SignatureFieldAppearance
object representing signature appearance
-
getCertificationLevel
Returns the document's certification level. For possible values seeAccessPermissions
.- Returns:
-
AccessPermissions
enum which specifies which certification level shall be used
-
setCertificationLevel
Sets the document's certification level.- Parameters:
-
accessPermissions
-AccessPermissions
enum which specifies which certification level shall be used - Returns:
- this instance to support fluent interface
-
getFieldName
Gets the field name.- Returns:
- the field name
-
setFieldName
Sets the name indicating the field to be signed. The field can already be presented in the document but shall not be signed. If the field is not presented in the document, it will be created.Note that ID specified for
SignatureFieldAppearance
set bysetSignatureAppearance(com.itextpdf.forms.form.element.SignatureFieldAppearance)
will be ignored and won't override the field name.- Parameters:
-
fieldName
- the name indicating the field to be signed - Returns:
- this instance to support fluent interface
-
getPageNumber
public int getPageNumber()Provides the page number of the signature field which this signature appearance is associated with.- Returns:
- the page number of the signature field which this signature appearance is associated with
-
setPageNumber
Sets the page number of the signature field which this signature appearance is associated with.- Parameters:
-
pageNumber
- the page number of the signature field which this signature appearance is associated with - Returns:
- this instance to support fluent interface
-
getPageRect
Provides the rectangle that represent the position and dimension of the signature field in the page.- Returns:
- the rectangle that represent the position and dimension of the signature field in the page
-
setPageRect
Sets the rectangle that represent the position and dimension of the signature field in the page.- Parameters:
-
pageRect
- the rectangle that represents the position and dimension of the signature field in the page - Returns:
- this instance to support fluent interface
-
getFieldLockDict
Getter for the field lock dictionary.- Returns:
- field lock dictionary
-
setFieldLockDict
Setter for the field lock dictionary.Be aware: if a signature is created on an existing signature field, then its /Lock dictionary takes the precedence (if it exists).
- Parameters:
-
fieldLock
- field lock dictionary - Returns:
- this instance to support fluent interface
-
getSignatureCreator
Returns the signature creator.- Returns:
- the signature creator
-
setSignatureCreator
Sets the name of the application used to create the signature.- Parameters:
-
signatureCreator
- A new name of the application signing a document. - Returns:
- this instance to support fluent interface.
-
getContact
Returns the signing contact.- Returns:
- the signing contact
-
setContact
Sets the signing contact.- Parameters:
-
contact
- a new signing contact - Returns:
- this instance to support fluent interface
-
getReason
Returns the signing reason.- Returns:
- the signing reason
-
setReason
Sets the signing reason.- Parameters:
-
reason
- a new signing reason - Returns:
- this instance to support fluent interface
-
getLocation
Returns the signing location.- Returns:
- the signing location
-
setLocation
Sets the signing location.- Parameters:
-
location
- a new signing location - Returns:
- this instance to support fluent interface
-