Last active
June 19, 2019 12:48
-
-
Save GroupDocsGists/1ef15f1094a8064f52832fd8bc439b8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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