Class PDSignatureField

All Implemented Interfaces:
COSObjectable

public class PDSignatureField extends PDTerminalField
A signature field is a form field that contains a digital signature.
  • Field Details

    • LOG

      private static final org.apache.commons.logging.Log LOG
  • Constructor Details

    • PDSignatureField

      public PDSignatureField(PDAcroForm acroForm) throws IOException
      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

      private String generatePartialName()
      Generate a unique name for the signature.
      Returns:
      the signature's unique name
    • setSignature

      @Deprecated public void setSignature(PDSignature value) throws IOException
      Deprecated.
      Add a signature dictionary to the signature field.
      Parameters:
      value - is the PDSignatureField
      Throws:
      IOException
    • getSignature

      public PDSignature getSignature()
      Get the signature dictionary.
      Returns:
      the signature dictionary
    • setValue

      public void setValue(PDSignature value) throws IOException
      Sets the value of this field to be the given signature.
      Parameters:
      value - is the PDSignatureField
      Throws:
      IOException
    • setValue

      public void setValue(String value)
      This will throw an UnsupportedOperationException if used as the signature fields value can't be set using a String
      Specified by:
      setValue in class PDField
      Parameters:
      value - the plain text value.
      Throws:
      UnsupportedOperationException - in all cases!
    • setDefaultValue

      public void setDefaultValue(PDSignature value) throws IOException
      Sets the default value of this field to be the given signature.
      Parameters:
      value - is the PDSignatureField
      Throws:
      IOException
    • 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 String getValueAsString()
      Description copied from class: PDField
      Returns a string representation of the "V" entry, or an empty string.
      Specified by:
      getValueAsString in class PDField
      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 IOException
      Description copied from class: PDTerminalField
      Constructs appearance streams and appearance dictionaries for all widget annotations. Subclasses should not call this method directly but via PDTerminalField.applyChange().
      Specified by:
      constructAppearances in class PDTerminalField
      Throws:
      IOException - if the appearance couldn't be generated