GroupDocsGists
10/24/2017 - 7:08 AM

GroupDocs.Viewer.3.0.0.ApplyWatermark.cs


// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.StoragePath = @"C:\storage";
 
// Create image handler
ViewerHtmlHandler Handler = new ViewerHtmlHandler(config);
string guid = "word.doc";
  
HtmlOptions options = new HtmlOptions();
  
// Set watermark properties
Watermark watermark = new Watermark("This is watermark text");
watermark.Color = System.Drawing.Color.Blue;
watermark.Position = WatermarkPosition.Diagonal;
watermark.Width = 100;
 
options.Watermark = watermark;
  
// Get document pages Html representation with watermark
List<PageHtml> pages = Handler.GetPages(guid, options);