Last active
June 20, 2018 05:49
-
-
Save GroupDocsGists/e1ad119ec2a7a89d32a93976438238ad to your computer and use it in GitHub Desktop.
GroupDocs.Watermark for .NET 18.6
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>(Utilities.MapSourceFilePath(FILE_PATH))) | |
{ | |
TextWatermark watermark = new TextWatermark("Watermark text", new Font("Arial", 19)); | |
watermark.ForegroundColor = Color.Red; | |
WordsShapeSettings settings = new WordsShapeSettings(); | |
settings.IsLocked = true; | |
settings.LockType = WordsLockType.AllowOnlyFormFields; | |
// To protect with password | |
//settings.Password = "7654321"; | |
doc.AddWatermark(watermark, settings); | |
doc.Save(); | |
} |
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>(Utilities.MapSourceFilePath(FILE_PATH))) | |
{ | |
TextWatermark watermark = new TextWatermark("Watermark text", new Font("Arial", 19)); | |
watermark.ForegroundColor = Color.Red; | |
WordsShapeSettings settings = new WordsShapeSettings(); | |
settings.PageNumbers = new int[] { 1, 3 }; | |
settings.IsLocked = true; | |
settings.LockType = WordsLockType.AllowOnlyComments; | |
// To protect with password | |
//settings.Password = "7654321"; | |
doc.AddWatermark(watermark, settings); | |
doc.Save(); | |
} |
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>(Utilities.MapSourceFilePath(FILE_PATH))) | |
{ | |
TextWatermark watermark = new TextWatermark("Watermark text", new Font("Arial", 19)); | |
watermark.ForegroundColor = Color.Red; | |
WordsShapeSettings settings = new WordsShapeSettings(); | |
settings.IsLocked = true; | |
settings.LockType = WordsLockType.ReadOnlyWithEditableContent; | |
// To protect with password | |
//settings.Password = "7654321"; | |
doc.Sections[0].AddWatermark(watermark, settings); | |
doc.Save(); | |
} |
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>(Utilities.MapSourceFilePath(FILE_PATH))) | |
{ | |
doc.Protect(WordsProtectionType.ReadOnly, "7654321"); | |
doc.Save(); | |
} |
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>(Utilities.MapSourceFilePath(FILE_PATH))) | |
{ | |
doc.Unprotect(); | |
doc.Save(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment