Last active
January 11, 2019 13:05
-
-
Save GroupDocsGists/6e932cfd172fab3553e4938bb67c9b64 to your computer and use it in GitHub Desktop.
GroupDocs.Viewer for .NET 18.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET | |
// Setup GroupDocs.Viewer config | |
ViewerConfig config = Utilities.GetConfigurations(); | |
// Create image handler | |
ViewerImageHandler imageHandler = new ViewerImageHandler(config); | |
string guid = DocumentName; | |
// Get document info | |
CadDocumentInfoContainer documentInfo = (CadDocumentInfoContainer)imageHandler.GetDocumentInfo(guid); | |
// Loop through all layers contained in the drawing | |
foreach (var layer in documentInfo.Layers) | |
Console.WriteLine("Layer name: {0}", layer.Name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
string guid = DocumentName; | |
// Set default font | |
HtmlOptions options = new HtmlOptions(); | |
options.DefaultFontName = "Calibri"; | |
// 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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
string guid = DocumentName; | |
// Instantiate HtmlOptions object and set RenderNotes property | |
HtmlOptions options = new HtmlOptions(); | |
options.SlidesOptions.RenderNotes = true; // Default value is false | |
// Get document pages in Html form | |
List<PageHtml> pages = htmlHandler.GetPages(guid, options); | |
foreach (PageHtml page in pages) | |
{ | |
//Save each page at disk | |
Utilities.SaveAsHtml(page.PageNumber + "_" + DocumentName, page.HtmlContent); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
string guid = DocumentName; | |
// Set CAD options to render specific layers | |
HtmlOptions options = new HtmlOptions(); | |
options.CadOptions.Layers.Add("electrical"); | |
options.CadOptions.Layers.Add("walls"); | |
// 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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment