In this how-to article, we will discuss the entire workflow to add watermark in Word using C# utilizing one of the popular annotation library. This tutorial provides a code example to insert watermark in Word using C# by consuming a couple of API calls. Furthermore, we will explain how to setup annotation package and write code example to insert formatted watermark in DOCX. Below are the complete instructions along with working example.
Steps to Add Watermark in Word using C#
- Install GroupDocs.Annotation for .NET package from the NuGet package manager in the .NET application to insert watermark in Word
- Add a reference to the GroupDocs.Annotation namespace to create watermark in Word
- Initialize Annotator class by passing input DOCX path
- Initialize WatermarkAnnotation class and set watermark’s properties
- Call the Add method of Annotator class and pass the WatermarkAnnotation object to it
- Finally, call Annotator.Save method to save the Word document to disk
The above steps help you to quickly create watermark in Word using C# without setting up any additional third-party tools on your system. You can follow these steps on Windows, macOS, Linux and any operating system that supports .NET to insert watermark annotation in DOCX. Following code example generates Word document with watermark according set properties of WatermarkAnnotation.
Code to Add Watermark in Word using C#
The above sample code example has been built to add watermark to word document in C# with simple steps. You can modify this code example and set watermark properties according to your requirement with the help of WatermarkAnnotation properties. Recently, we brought out an article to remove watermark annotation from PDF, have a look at how to remove watermark annotation from PDF using C# guide for detail.