Last active
November 2, 2019 14:02
-
-
Save GroupDocsGists/e04a73ccf29f6bab61c59ffa5a8daeca 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
WordProcessingLoadOptions loadOptions = new WordProcessingLoadOptions(); | |
using (Watermarker watermarker = new Watermarker("document.docx", loadOptions)) | |
{ | |
TextWatermark watermark = new TextWatermark("Watermark text", new Font("Arial", 19)); | |
watermark.ForegroundColor = Color.Red; | |
WordProcessingWatermarkPagesOptions options = new WordProcessingWatermarkPagesOptions(); | |
options.IsLocked = true; | |
options.LockType = WordProcessingLockType.AllowOnlyComments; | |
/* | |
options.LockType = WordProcessingLockType.AllowOnlyRevisions; | |
options.LockType = WordProcessingLockType.AllowOnlyFormFields; | |
options.LockType = WordProcessingLockType.ReadOnlyWithEditableContent; | |
options.LockType = WordProcessingLockType.ReadOnly; | |
*/ | |
// To protect with password | |
//options.Password = "7654321"; | |
watermarker.Add(watermark, options); | |
watermarker.Save("document_watermarked.docx"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment