
In my previous post, I demonstrated how to create MS Visio diagrams from scratch in Node.js. In this article, I’ll show you how to use Aspose.Diagram to export or convert Visio diagrams to popular file formats in Node.js applications.
Converting Visio diagrams is useful in many scenarios. You can convert a diagram to HTML or JPEG/PNG to display it on a web page or in a Visio viewer. Visio to PDF conversion removes the need for dedicated viewing software. Aspose.Diagram provides high‑quality conversion for these cases.
- Convert Visio to PDF in Node.js
- Convert Visio Diagram to PNG/JPEG/Other Image Formats
- Export Visio Diagrams to SVG in Node.js
- Convert Visio Diagram to HTML in Node.js
- Visio to XAML Conversion in Node.js
Node.js Visio Converter API - Installation
You can install Aspose.Diagram into your Node.js application using the following npm command.
npm install aspose.diagram --save
Convert Visio to PDF in Node.js
PDF is a platform‑independent format that keeps document content stable across environments. Converting a Visio diagram to PDF ensures reliable sharing without requiring special software. Follow these steps to convert a Visio diagram to PDF with Aspose.Diagram.
- Load the VSD/VSDX Visio diagram using the Diagram class.
- Export the diagram to PDF using Diagram.save(string, SaveFileFormat) method.
The code sample below converts a Visio VSDX to PDF in Node.js.
VSDX File

PDF File

Convert Visio to PNG/JPEG/Other Images in Node.js
Converting Visio diagrams to images is useful for thumbnails or viewer displays. Aspose.Diagram supports these image formats:
- PNG
- JPEG
- TIFF
- BMP
- EMF
Steps to convert Visio diagrams to images:
- Load the Visio diagram using the Diagram class.
- Create an ImageSaveOptions instance and set the desired format with the SaveFileFormat enumeration.
- Save the diagram as an image using Diagram.save(string, ImageSaveOptions) method.
The code sample below converts a Visio VSDX to PNG in Node.js.
Export Visio Diagrams to SVG in Node.js
You can convert a Visio diagram to SVG with just a few lines of code.
- Load the Visio diagram using the Diagram class.
- Export the diagram to SVG using Diagram.save(string, SaveFileFormat) method.
The code sample below converts a Visio VSDX to SVG in Node.js.
Convert Visio Diagram to HTML in Node.js
Aspose.Diagram can also convert a Visio diagram into an HTML document with a navigation sidebar.
- Create a Diagram instance and load the Visio file.
- Save the diagram as HTML using Diagram.save(string, SaveFileFormat) method.
The code sample below converts a Visio VSDX to HTML in Node.js.
Visio to HTML

Convert Visio to XAML in Node.js
You can also convert a Visio diagram to XAML, Microsoft’s Extensible Application Markup Language.
- Load the VSDX file using the Diagram class.
- Save the file as XAML using Diagram.save(string, SaveFileFormat) method.
The code sample below converts a Visio VSDX to XAML in Node.js.
Conclusion
We have shown how to convert MS Visio diagrams to PDF, PNG, JPEG, SVG, HTML, and XAML in Node.js using Aspose.Diagram. For more details, see the documentation.