GroupDocsGists
10/24/2017 - 7:08 AM

Examples-GroupDocs.Viewer.Examples.CSharp-GroupDocs.Viewer.Examples-ViewGenerator-RenderRemoteDocAsHtml.cs

// For complete examples and data files, please go to https://github.com/groupdocsviewer/GroupDocs_Viewer_NET
//Get Configurations 
 ViewerConfig config = Utilities.GetConfigurations();

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

 //Instantiate the HtmlOptions object
 HtmlOptions options = new HtmlOptions();

 if (!String.IsNullOrEmpty(DocumentPassword))
     options.Password = DocumentPassword;
 
 //Get document pages in html form
 List<PageHtml> pages = htmlHandler.GetPages(DocumentURL,options);
 
 foreach (PageHtml page in pages)
 {
     //Save each page at disk
     Utilities.SaveAsHtml(page.PageNumber + "_" + Path.GetFileName(DocumentURL.LocalPath), page.HtmlContent);
 }