Convert a Visio Shape To Html
Contents
[
Hide
]
**Convert a visio shape to html **
The ToHTML method exposed by the Shape class can be used to convert to html.
The code below shows how to:
- Load a sample diagram.
- get a particular page.
- get a particular shape.
- convert shape to html.
Shape to Html
Use the following code in your java application to convert a visio shape to html.
// For complete examples and data files, please go to https://github.com/aspose-diagram/Aspose.Diagram-for-Java
// The path to the documents directory.
String dataDir = Utils.getDataDir(ShapeToHtml.class);
// Call a Diagram class constructor to load the VSDX diagram
Diagram diagram = new Diagram(dataDir + "ShapeToHtml.vsdx");
// Get a particular page
Page page = diagram.getPages().get(0);
// Get a particular shape
Shape shape = page.getShapes().get(0);
// Shape to HTML
HTMLSaveOptions hs = new HTMLSaveOptions();
shape.toHTML("out.htm", hs);