GroupDocsGists
10/19/2017 - 11:15 AM

GetPrintableHtml.cs

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

// create html handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);

// guid implies that unique document name 
string guid = DocumentName;

PrintableHtmlOptions printableHtmlOptions = new PrintableHtmlOptions();

// get printable html in PrintableHtmlContainer
PrintableHtmlContainer container = htmlHandler.GetPrintableHtml(guid, printableHtmlOptions);
 
// save html content 
Utilities.SaveAsHtml(guid, container.HtmlContent);