Watermarks are usually used to show ownership or classification of a document. In this article, we will learn to work with watermark in word documents using Aspose.Words for .NET API. Let us cover the following use cases related to watermark.

Add Text Watermark in Word Document with C#

You can add or insert text watermark in a word document, be it a DOC or DOCX file. Simply follow the steps below for adding text watermark:

  1. Load input DOC/DOCX file
  2. Set different TextWatermarkOptions including Font and Layout
  3. Set text of the watermark
  4. Save the output word file

Following code snippet shows how to add watermark in word document (DOC/DOCX) using C#:

The screenshot below is a sample output created by above C# code snippet:

Watermark in word

Add Image Watermark in Word Document with C#

You can also add an image as a watermark in a word document. The image can be added in addition to the text, as we have learned in the previous example. You can follow below steps to add image watermark in a word document:

  1. Load input word file
  2. Initialize ImageWatermarkOptions object
  3. Set image as watermark in the word document
  4. Save the output file

Following code snippet is based on these steps which show how to add image watermark in word documents using C#:

We have used Aspose logo image as sample image so you can observe the output in Print Preview of Microsoft Word application where an image is set as a watermark of the document. Following screenshot depicts the output word file:

image watermark in word file

Remove Watermark in Word Document using C#

You can easily remove or delete a watermark from word document using C#. Let us follow the steps below for removing a watermark from the word document.

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

Following code snippet shows how to remove a watermark from word document with C#:

Conclusion

We have learned how to add or insert text watermark in word documents. Moreover, we have also explored how to add image watermark in word documents. You can use these features separately or maybe in combination as well, i.e Adding text and image watermark in word document at the same time. Furthermore, your .NET application can be efficient enough to remove or watermarks from word documents. We have created this article as a simple guide to work with watermarks in word. In case of any query or concerns, please contact us via Free Support Forum.

See Also