Watermarks are commonly used to indicate ownership or classification of a document. In this article we will work with watermarks in Word documents using the Aspose.Words for .NET API. The following use cases are covered:

Add Text Watermark in Word Document with C#

You can insert a text watermark into a DOC or DOCX file. Follow these steps:

  1. Load the input DOC/DOCX file
  2. Configure TextWatermarkOptions (font, layout, etc.)
  3. Set the watermark text
  4. Save the output Word file

The code snippet below demonstrates how to add a text watermark using C#:

The screenshot shows the result produced by the code:

Watermark in word

Add Image Watermark in Word Document with C#

You can also add an image as a watermark. The image can be combined with text if needed. Follow these steps:

  1. Load the input Word file
  2. Initialize an ImageWatermarkOptions object
  3. Set the image as the watermark
  4. Save the output file

The following snippet follows these steps to add an image watermark:

The sample uses the Aspose logo as the watermark image. The preview in Microsoft Word shows the image applied to the document:

image watermark in word file

Remove Watermark in Word Document using C#

You can delete a watermark from a Word document with C#. Follow these steps:

  1. Load the input Word file
  2. Specify the watermark type to remove
  3. Remove the watermark
  4. Save the output Word file

The code below removes a watermark from a Word document:

Conclusion

We demonstrated how to add text and image watermarks to Word documents and how to remove them using C#. These techniques can be used individually or together, such as adding both text and image watermarks in a single document. Your .NET application can efficiently manage watermarks in Word files. For questions or support, visit our Free Support Forum.

See Also