Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created May 13, 2020 16:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/7ec04b775b208175a41a3c108a6587d1 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/7ec04b775b208175a41a3c108a6587d1 to your computer and use it in GitHub Desktop.
Convert Visio Diagrams in Node.js
var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
// Load Visio VSDX file
var diagram = new aspose.diagram.Diagram("sample.vsdx");
// Save as HTML file format
diagram.save("Visio-to-HTML.html", aspose.diagram.SaveFileFormat.HTML);
var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
// Load Visio VSDX file
var diagram = new aspose.diagram.Diagram("sample.vsdx");
// Save as PDF file format
diagram.save("Visio to PDF.pdf", aspose.diagram.SaveFileFormat.PDF);
var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
// Load Visio VSDX file
var diagram = new aspose.diagram.Diagram("sample.vsdx");
// Set image options
options = new aspose.diagram.ImageSaveOptions(aspose.diagram.SaveFileFormat.PNG);
// Save one page only if you want to convert a particular page.
options.setPageIndex(0);
// Save as PNG file format
diagram.save("Visio to PNG.png", options);
var aspose = aspose || {};
aspose.diagram = require("aspose.diagram")
// Load Visio VSDX file
var diagram = new aspose.diagram.Diagram("sample.vsdx");
// Save as SVG file format
diagram.save("Visio-to-SVG.svg", aspose.diagram.SaveFileFormat.SVG);
var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
// Load Visio VSDX file
var diagram = new aspose.diagram.Diagram("sample.vsdx");
// Save as XAML file format
diagram.save("Visio-to-XAML.xaml", aspose.diagram.SaveFileFormat.XAML);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment