Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/f1415ae3e6563cbfb2c14103433a88ea to your computer and use it in GitHub Desktop.
Save GroupDocsGists/f1415ae3e6563cbfb2c14103433a88ea to your computer and use it in GitHub Desktop.
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java
// Get Configurations
ViewerConfig config = Utilities.getConfiguration();
// Create html handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
String guid = DocumentName;
// Set CAD options to render two Layers
HtmlOptions options = new HtmlOptions();
options.getCadOptions().getLayers().add("electrical");
options.getCadOptions().getLayers().add("walls");
// Get pages
List<PageHtml> pages = htmlHandler.getPages(guid, options);
for (PageHtml page : pages)
{
//Save each page at disk
Utilities.saveAsHtml(page.getPageNumber() + "_" + DocumentName, page.getHtmlContent());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment