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
- Create an account and get API credentials
- Download Aspose.Words Cloud SDK for Dotnet to add a watermark in a Word file
- Setup C# solution project with the above SDK for putting the watermark
Steps to Insert a Watermark in Word with C# Low Code API
- Create the WordsApi object by providing the client ID/secret to insert a watermark
- Create the WatermarkDataText object and set its basic parameters
- Instantiate the InsertWatermarkRequest method using the input Word file and watermark object
- Call the InsertWatermark method using the defined request object
- Download the resultant Word file using the destination file name used in the InsertWatermarkRequest object
- 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.