GroupDocsGists
10/19/2017 - 11:14 AM

GetPrintableHTML.vb

' For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET
'Get Configurations
Dim config As ViewerConfig = Utilities.GetConfigurations()

' Create html handler
Dim htmlHandler As New ViewerHtmlHandler(config)

' Guid implies that unique document name 
Dim guid As String = DocumentName

' Setup watermark and style
Dim watermark As New Watermark("Watermark text")
Dim css As String = "a { color: hotpink; }"

' Setup printable options
Dim options = New PrintableHtmlOptions()
options.Watermark = watermark
options.Css = css

' Get document html for print with custom css and watermark
Dim container = htmlHandler.GetPrintableHtml(guid, options)

Console.WriteLine("Html content: {0}", container.HtmlContent)