Add a Watermark in Word with NET REST API

This article describes how to add a watermark in Word with NET REST API. You will learn how to include watermark in Word with C# REST API using Aspose.Words for .NET Cloud SDK. Various properties are discussed to set the formatting and text of the watermark.

Prerequisite

Steps to Insert a Watermark in Word with C# Low Code API

  1. Create the WordsApi object by providing the client ID/secret to insert a watermark
  2. Create the WatermarkDataText object and set its basic parameters
  3. Instantiate the InsertWatermarkRequest method using the input Word file and watermark object
  4. Call the InsertWatermark method using the defined request object
  5. Download the resultant Word file using the destination file name used in the InsertWatermarkRequest object
  6. Download the output Word file with a watermark

The above steps define how to insert a watermark in Word with C# Low Code API. Commence the process by creating the WatermarkDataText that has the properties to set the text, formatting, and layout of the watermark. Use this object in the InsertWatermarkRequest object that is ultimately used for inserting the watermark with the WordsApi.InsertWatermark() method.

Code to Insert Draft Watermark in Word with C# REST API

This sample code exhibits how to put a watermark in Word with NET REST API. You can set the Layout property to Diagonal or horizontal, set the flag to semi-transparent, and color of the watermark. The final output file is available in the cloud and can be downloaded using the DownloadFile() method.

In this topic, we have learned the process of adding watermarks in Word. If you are looking to add page numbers in a Word file, refer to the following article: Add a page number in Word with NET REST API.

 English