Deleting multiple signatures of different types

GroupDocs.Signature provides different classes of signatures to manipulate and delete them from the documents over delete  method.

Please be aware that delete  method modifies the same document that was passed to constructor of Signature class. This method returns DeleteResult object that contains list of successfully updated signatures and ones that failed. The signature could be failed to delete due to several reasons:

  • if signature object was initialized with constructor by incorrect signature identifier;
  • if signature object was not found;
  • there was an error occurred while deleting signature in the document;
  • the signature type is not supported for deletion for current version (for version 19.12 these signatures are Digital, Form Field or Metadata signature).

Here are the steps to delete multiple signature in the document with GroupDocs.Signature:

  • Create new instance of Signature class and pass source document path as a constructor parameter;

  • Instantiate one or several Search options with desired properties;

  • Call search method and pass created list of Search Options to obtain list of BaseSignatures;

  • Select from list BaseSignatures object(s) that should be deleted;

  • Call Signature object delete method and pass one or several signatures to it.

  • Analyze DeleteResult result to check whether signatures were updated or not.

Delete multiple signatures in the document

This example shows how to delete multiple signatures that was found using  search method.

// initialize Signature instance
Signature signature = new Signature("signed.docx")
// define few search options
BarcodeSearchOptions barcodeOptions = new BarcodeSearchOptions();
QrCodeSearchOptions qrCodeOptions = new QrCodeSearchOptions();
// add options to list
List<SearchOptions> listOptions = new ArrayList<SearchOptions>();
// search for signatures in document
SearchResult result =;
if (result.getSignatures().size() > 0)
    System.out.print("Trying to delete signatures...");
    List<BaseSignature> signaturesToDelete = new ArrayList<BaseSignature>();
    // collect image signatures to delete
    for (BaseSignature temp : result.getSignatures())
    // delete signatures
    DeleteResult deleteResult = signature.delete("signed.docx",signaturesToDelete);
    if (deleteResult.getSucceeded().size() == signaturesToDelete.size())
        System.out.print("All signatures were successfully deleted!");
        System.out.print("Successfully deleted signatures : " + deleteResult.getSucceeded().size());
        System.out.print("Not deleted signatures : " + deleteResult.getFailed().size());
    System.out.print("List of deleted signatures:");
    for(BaseSignature temp : deleteResult.getSucceeded())
        System.out.print("Signature# Id:"+temp.getSignatureId()+", Location: "+temp.getLeft()+"x"+temp.getTop()+". Size: "+temp.getWidth()+"x"+temp.getHeight());
    System.out.print("No one signature was found.");

More resources

GitHub Examples 

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online App 

Along with full-featured .NET library we provide simple, but powerful free Apps.
You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online GroupDocs Signature App.