usingGroupDocs.Watermark;usingGroupDocs.Watermark.Watermarks;// Specify an absolute or relative path to your document.using(Watermarkerwatermarker=newWatermarker("C:\\Docs\\sample.docx")){// Specify the desired text and font for the watermarkTextWatermarkwatermark=newTextWatermark("Test watermark",newFont("Arial",36,FontStyle.Bold|FontStyle.Italic));watermark.HorizontalAlignment=HorizontalAlignment.Center;watermark.VerticalAlignment=VerticalAlignment.Center;watermark.Opacity=0.4;watermark.RotateAngle=45;watermark.ForegroundColor=Color.Red;// Apply the watermarkwatermarker.Add(watermark);// Save the resulting documentwatermarker.Save("C:\\Docs\\watermarked-sample.docx");}
Running
Run the program. A new watermarked document will appear in the specified path.
What’s next
Congratulations! You have added a simple text watermark to a document. Read the Developer guide and API reference to learn how to customize text watermarks, add images as watermarks, search documents for existing watermarks, and much more.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.