How to Insert Watermark in Word Document using C#

This tutorial will guide you through how to insert watermark in Word document using C#. You will get information about the configuration, steps, and a runnable sample code to add watermark to Word using C#. Different options will also be discussed to customize the watermark and then save the output file as DOCX, DOC, or in any other format.

Steps to Add Watermark to Word Document using C#

  1. Establish the environment to use Aspose.Words for .NET to add watermark
  2. Create or load a Word document using the Document class object
  3. Create the TextWatermarkOptions object to set the watermark parameters
  4. Set the watermark text
  5. Save the Word document

The environment configuration and steps are described in these steps to put a watermark on a Word document using C#. The Document class object is used to load the Word file and then the TextWatermarkOptions object is used for the watermark customization. In the end, the text for the watermark is set along with the custom properties, and the output file is saved in the desired format.

Code to Insert Watermark in Word using C#

This sample code demonstrates how to create watermark in Word using C#. The TextWatermarkOptions object is used to set the font family, font size, color, layout, and transparency of the watermark. The layout of the watermark is set to diagonal however you may use Horizontal as an alternate option.

In this article, we have learned the process to add a watermark to a Word file. If you want to learn the process to add an image in a Word document, refer to the article on how to add image in Word document using C#.

 English