Remove a Watermark in Word using Java

This short tutorial explains the process to remove a watermark in Word using Java. It provides the details to set the IDE, a list of steps, and a sample code demonstrating how to delete watermark in Word using Java by using a few API calls. You can remove the text and image watermarks by slight variations in the code.

Steps to Remove a Watermark From a Word Document using Java

  1. Setup the IDE for working with Aspose.Words for Java API to remove a watermark
  2. Load the source Word file having a text or image watermark in it
  3. Check the type of the Watermark property of the document
  4. Call the remove() method if type is TEXT
  5. Save the output Word file

Here is a step-by-step procedure showing how to remove a watermark from a Word document using Java. Load the source Word file into a Document class object, check the watermark type of the loaded Word file, and call the remove() method if a watermark is present in the file. Save the output Word file after erasing the Watermark.

Code to Remove Word Watermark using Java

This code snippet demonstrates how to remove draft watermark in Word using Java. There can be two types of watermarks in a Word file i.e. IMAGE or TEXT. You can delete these watermarks by just checking the watermark type against IMAGE or TEXT and calling the same method remove() to erase it.

This article has taught us the process of removing a watermark. If you want to unprotect a Word file, refer to the article on How to unprotect Word file in Java.

 English