Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
using (WordsDocument doc = Document.Load<WordsDocument>(@"D:\test.docx"))
{
TextWatermark watermark = new TextWatermark("Test watermark", new Font("Arial", 19));
WordsShapeSettings shapeSettings = new WordsShapeSettings();
//Some settings for watermark
watermark.VerticalAlignment = VerticalAlignment.Center;
watermark.HorizontalAlignment = HorizontalAlignment.Center;
watermark.RotateAngle = 25.0;
watermark.ForegroundColor = Color.Red;
watermark.Opacity = 1.0;
// Set the shape name
shapeSettings.Name = "Shape 1";
// Set the descriptive (alternative) text that will be associated with the shape
shapeSettings.AlternativeText = "Test watermark";
doc.AddWatermark(watermark, shapeSettings);
doc.Save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.