com.groupdocs.signature

Class Signature



  • public class Signature
    extends Object

    Represents main class that controls document signing process.

    • Method Detail

      • delete

        public final boolean delete(OutputStream document,
                     BaseSignature signature)
                             throws Exception

        Deletes passed signature BaseSignature from the document.

        Parameters:
        signature - Signature object to be removed from the document.
        Returns:
        Returns true if operation was successful.
        Throws:
        Exception
      • delete

        public final boolean delete(String filePath,
                     BaseSignature signature)
                             throws Exception

        Deletes passed signature BaseSignature from the document.

        Parameters:
        signature - Signature object to be removed from the document.
        filePath - The output file path.
        Returns:
        Returns true if operation was successful.
        Throws:
        Exception
      • delete

        public final DeleteResult delete(String filePath,
                          List<BaseSignature> signatures)
                                  throws Exception

        Deletes passed list of signatures BaseSignature from the document.

        Parameters:
        signatures - List of signatures to remove from the document.
        filePath - The output file path.
        Returns:
        Returns DeleteResult DeleteResult with list of successfully deleted signatures and failed ones.
        Throws:
        Exception
      • dispose

        public final void dispose()

        Implement IDisposable interface to clean up internal resources

      • generatePreview

        public final void generatePreview(PreviewOptions previewOptions)
                                   throws Exception

        Generates document pages preview.

        Parameters:
        previewOptions - The preview options.
        Throws:
        Exception
      • getDocumentInfo

        public final IDocumentInfo getDocumentInfo()
                                            throws Exception

        Gets information about document pages: their sizes, maximum page height, the width of a page with the maximum height.

        Returns:
        Information about document.
        Throws:
        Exception
      • search

        public final <T extends BaseSignatureList<T> search(Class<T> typeOfT,
                                               int signatureType)
                                                   throws Exception

        Searches for exact type of signatures in the document by value.

        Parameters:
        signatureType - The type of signatures to search.
        Returns:
        Returns the list of found signatures with exact type.
        Throws:
        Exception
      • search

        public final SearchResult search(int... signatureTypes)
                                  throws Exception

        Searches for specified signature types in the document by value.

        Parameters:
        signatureTypes - One or several types of signatures to find.
        Returns:
        Returns instance of SearchResult with list of found signatures.
        Throws:
        Exception
      • sign

        public final SignResult sign(OutputStream document,
                      List<SignOptions> signOptionsList)
                              throws Exception

        Signs document with collection of SignOptions and saves result to a stream.

        Parameters:
        document - The output document stream.
        signOptionsList - The list of signature options.
        Returns:
        Returns instance of SignResult with list of newly created signatures.
        Throws:
        Exception
      • sign

        public final SignResult sign(String filePath,
                      List<SignOptions> signOptionsList)
                              throws Exception

        Signs document with collection of SignOptions and saves result to specified file path.

        Parameters:
        filePath - The output file path.
        signOptionsList - The list of signature options.
        Returns:
        Throws:
        Exception
      • sign

        public final SignResult sign(String filePath,
                      List<SignOptions> signOptionsList,
                      SaveOptions saveOptions)
                              throws Exception

        Signs document with collection of SignOptions and saves result to specified file path with predefined SaveOptions.

        Parameters:
        filePath - The output file path.
        signOptionsList - The list of signature options.
        saveOptions - The save options.
        Returns:
        Returns instance of SignResult with list of newly created signatures.
        Throws:
        Exception
      • sign

        public final SignResult sign(String filePath,
                      SignOptions signOptions)
                              throws Exception

        Signs document with SignOptions and saves result to specified file path.

        Parameters:
        filePath - The output file path.
        signOptions - The signature options.
        Returns:
        Returns instance of SignResult with list of newly created signatures.
        Throws:
        Exception
      • update

        public final boolean update(OutputStream document,
                     BaseSignature signature)
                             throws Exception

        Updates passed signature BaseSignature in the document.

        Parameters:
        signature - Signature object to be updated in the document.
        Returns:
        Returns true if operation was successful.
        Throws:
        Exception
      • update

        public final boolean update(String filePath,
                     BaseSignature signature)
                             throws Exception

        Updates passed signature BaseSignature in the document.

        Parameters:
        signature - Signature object to be updated in the document.
        filePath - The output file path.
        Returns:
        Returns true if operation was successful.
        Throws:
        Exception
      • update

        public final UpdateResult update(String filePath,
                          List<BaseSignature> signatures)
                                  throws Exception

        Updates passed signatures BaseSignature in the document.

        Parameters:
        signatures - List of signatures to update in the document.
        filePath - The output file path.
        Returns:
        Returns UpdateResult UpdateResult with list of successfully updated signatures and failed ones.
        Throws:
        Exception
      • verify

        public final VerificationResult verify(List<VerifyOptions> verifyOptionsList)
                                        throws Exception

        Verifies the document signatures with list of VerifyOptions data.

        Parameters:
        verifyOptionsList - The signature verification options collection. Instance of VerifyOptionsCollection.
        Returns:
        Returns instance of VerificationResult. Property VerificationResult.IsValid returns true if verification process was successful.
        Throws:
        Exception
      • verify

        public final VerificationResult verify(VerifyOptions verifyOptions)
                                        throws Exception

        Verifies the document signatures with given VerifyOptions data.

        Parameters:
        verifyOptions - The signature verification options.
        Returns:
        Returns instance of VerificationResult. Property VerificationResult.IsValid returns true if verification process was successful.
        Throws:
        Exception