The following code snippet shows how to apply the watermark to the output pages.
importcom.groupdocs.viewer.Viewer;importcom.groupdocs.viewer.options.HtmlViewOptions;importcom.groupdocs.viewer.options.Watermark;// ...
try(Viewerviewer=newViewer("sample.docx")){// Create an HTML file.
HtmlViewOptionsviewOptions=HtmlViewOptions.forEmbeddedResources();// Add watermark.
viewOptions.setWatermark(newWatermark("This is a watermark"));viewer.view(viewOptions);}
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
Ask AI
Ask anything about this page — the answer is based on its content.
Searching the docs and writing an answer…
Something went wrong while getting an answer. Please try again in a moment.