Remove Signature from Word Document using Java

Follow this quick tutorial to remove signature from Word document using Java. You will learn to access the signatures in a Word file and remove them using an API call in the library. This tutorial will provide the IDE settings, a list of steps, and a sample code showing how to remove signature from Word document using Java.

Steps to Delete Signature in Word using Java

  1. Set the development environment to use Aspose.Words for Java for removing all signatures from a Word file
  2. Import the DigitalSignatureCollection, DigitalSignatureUtil, and the license classes
  3. Load the license for creating a watermark-free output
  4. Use the DigitalSignatureUtil class to load all the signatures in the source Word file
  5. Display the number of signatures in the collection for confirmation
  6. Call the removeAllSignatures() method in the DigitalSignatureUtil class for removing all the signatures
  7. Load the signatures collection from the output Word file and confirm the zero signatures

The above-mentioned steps describe how to remove a signature from a Word document using Java. Import the desired classes, load the license, load the collection of signatures from the source Word file, and display the count of signatures for confirmation. Next, call the removeAllSignatures() method by passing the input and output Word file, load the signatures again from the output Word file and confirm that no signature exists in the output Word file.

Code to Remove Digital Signature from Word Document using Java

The aforementioned code describes how to delete signature in Word. You can load existing signatures from a stream instead of a physical local Word file, and similarly, signatures can be removed from a Word file stream for creating a signature-free output Word file stream. The DigitalSignatureUtil contains other features, such as signing a Word file using different overloaded functions.

This article has taught us the process of removing signatures. To add section breaks in a Word file, refer to the article Add Sections to Word Document in Java.