usmanazizgroupdocs
3/6/2017 - 3:36 PM

RenderPDFLayersSeparately.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);
            
// Set pdf options to render pdf layers into separate html elements
HtmlOptions options = new HtmlOptions();
options.PdfOptions.RenderLayersSeparately = true; // Default value is false

//Get document pages in html form
List<PageHtml> pages = htmlHandler.GetPages(DocumentName, options);

foreach (PageHtml page in pages)
{
    //Save each page at disk
    Utilities.SaveAsHtml(page.PageNumber + "_" + DocumentName, page.HtmlContent);
}