The following code snippet shows how to apply the watermark to the output pages.
usingGroupDocs.Viewer;usingGroupDocs.Viewer.Options;// ...using(Viewerviewer=newViewer("sample.docx")){// Create an HTML file.HtmlViewOptionsviewOptions=HtmlViewOptions.ForEmbeddedResources();// Add watermarkviewOptions.Watermark=newWatermark("This is a watermark");viewer.View(viewOptions);}
ImportsGroupDocs.ViewerImportsGroupDocs.Viewer.Options' ...
ModuleProgramSubMain(argsAsString())UsingviewerAsViewer=NewViewer("sample.docx")' Create an HTML file.
DimviewOptionsAsHtmlViewOptions=HtmlViewOptions.ForEmbeddedResources()' Add watermark
viewOptions.Watermark=NewWatermark("This is a watermark")viewer.View(viewOptions)EndUsingEndSubEndModule
sample.docx is the sample file used in this example. Click here to download it.