Class SignerProperties

java.lang.Object
com.itextpdf.signatures.SignerProperties

public class SignerProperties extends Object
Properties to be used in signing operations.
  • Field Details

  • Constructor Details

    • SignerProperties

      public SignerProperties()
      Create instance of SignerProperties.
  • Method Details

    • getClaimedSignDate

      public Calendar getClaimedSignDate()
      Gets the signature date.
      Returns:
      calendar set to the signature date
    • setClaimedSignDate

      public SignerProperties setClaimedSignDate (Calendar signDate)
      Sets the signature date.
      Parameters:
      signDate - the signature date
      Returns:
      this instance to support fluent interface
    • setSignatureAppearance

      public SignerProperties setSignatureAppearance (SignatureFieldAppearance appearance)
      Sets the signature field layout element to customize the appearance of the signature. ID specified for SignatureFieldAppearance will be ignored and won't override field name, so IGNORED_ID could be used. To specify signature name use setFieldName(java.lang.String).

      Note that if SignedAppearanceText was set as the content (or part of the content) for SignatureFieldAppearance 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. Use setPageRect(Rectangle) and setPageNumber(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) and PdfSignatureFormField.setSignatureAppearanceLayer(com.itextpdf.kernel.pdf.xobject.PdfFormXObject) (n2 layer) for the signature field using PdfSigner.getSignatureField(). Page, rectangle and other properties could be also set up via SignerProperties.

      Parameters:
      appearance - the SignatureFieldAppearance layout element representing signature appearance
      Returns:
      this instance to support fluent interface
    • getSignatureAppearance

      public SignatureFieldAppearance getSignatureAppearance()
      Gets signature field appearance object representing the appearance of the signature.

      To customize the signature appearance, create new SignatureFieldAppearance object and set it using setSignatureAppearance(SignatureFieldAppearance).

      Returns:
      SignatureFieldAppearance object representing signature appearance
    • getCertificationLevel

      public AccessPermissions getCertificationLevel()
      Returns the document's certification level. For possible values see AccessPermissions.
      Returns:
      AccessPermissions enum which specifies which certification level shall be used
    • setCertificationLevel

      public SignerProperties setCertificationLevel (AccessPermissions accessPermissions)
      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

      public String getFieldName()
      Gets the field name.
      Returns:
      the field name
    • setFieldName

      public SignerProperties setFieldName (String fieldName)
      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 by setSignatureAppearance(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

      public SignerProperties setPageNumber (int pageNumber)
      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

      public Rectangle 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

      public SignerProperties setPageRect (Rectangle pageRect)
      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

      public PdfSigFieldLock getFieldLockDict()
      Getter for the field lock dictionary.
      Returns:
      field lock dictionary
    • setFieldLockDict

      public SignerProperties setFieldLockDict (PdfSigFieldLock fieldLock)
      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

      public String getSignatureCreator()
      Returns the signature creator.
      Returns:
      the signature creator
    • setSignatureCreator

      public SignerProperties setSignatureCreator (String signatureCreator)
      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

      public String getContact()
      Returns the signing contact.
      Returns:
      the signing contact
    • setContact

      public SignerProperties setContact (String contact)
      Sets the signing contact.
      Parameters:
      contact - a new signing contact
      Returns:
      this instance to support fluent interface
    • getReason

      public String getReason()
      Returns the signing reason.
      Returns:
      the signing reason
    • setReason

      public SignerProperties setReason (String reason)
      Sets the signing reason.
      Parameters:
      reason - a new signing reason
      Returns:
      this instance to support fluent interface
    • getLocation

      public String getLocation()
      Returns the signing location.
      Returns:
      the signing location
    • setLocation

      public SignerProperties setLocation (String location)
      Sets the signing location.
      Parameters:
      location - a new signing location
      Returns:
      this instance to support fluent interface