GroupDocsGists
10/19/2017 - 11:02 AM

RenderSpecificLayoutOfCADDocument.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;

// Set CAD options to render Model and all non empty Layouts
HtmlOptions options = new HtmlOptions();
options.CadOptions.LayoutName = "MyFirstLayout";

// Get pages 
List<PageHtml> pages = htmlHandler.GetPages(guid, options);

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