Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active July 3, 2021 22:05
Show Gist options
  • Save aspose-com-gists/99c48491d920f8ba4f0745c29b8c7e7b to your computer and use it in GitHub Desktop.
Save aspose-com-gists/99c48491d920f8ba4f0745c29b8c7e7b to your computer and use it in GitHub Desktop.
Convert Visio VSD/VSDX to JPG PNG BMP Image Programmatically in C#
// Load input diagram as VSD/VSDX file
Diagram diagram = new Diagram("ExportPageToImage.vsd");
// Specify output image format as PNG
ImageSaveOptions options = new ImageSaveOptions(SaveFileFormat.PNG);
// Save one page only, by page index
options.PageIndex = 0;
// Save resultant Image file
diagram.Save("ExportPageToImage_out.png", options);
// Call the diagram constructor to load a VSD/VSDX drawing
Diagram diagram = new Diagram("ExportToImage.vsd");
// Save output JPG, SVG, BMP, GIF, or SVG Image file
diagram.Save("ExportToImage_out.png", SaveFileFormat.PNG);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment