
Convert VSDX to PDF in Node.js
Aspose.Diagram offers a set of provisions to manipulate Microsoft Visio diagrams. It lets you automate updating, exporting, and creating Visio diagrams in Node.js applications. Aspose.Diagram for Node.js provides features to convert Visio files to popular formats such as PDF, PNG, and more. You can also export and print diagrams quickly. In this post we demonstrate how to convert VSDX to PDF in a Node.js application programmatically.
The following points are covered:
- Convert VSDX to PDF and PNG using Node.js - Visio API installation
- How to convert VSDX to PDF in Node.js
- Node.js library to convert VSDX to PNG
Convert VSDX to PDF and PNG using Node.js - Visio API installation
It is very easy to install this Node.js library in your project. Run the command below to add the package:
npm install aspose.diagram --save
How to convert VSDX to PDF in Node.js
In this section we provide a code snippet that converts a Visio diagram to PDF in a Node.js app.
Steps to convert Visio files to PDF:
- Initialize the Diagram() constructor to load a VSDX file.
- Create a PdfSaveOptions() object to configure PDF attributes.
- Call the setSplitMultiPages(true) method to split the diagram into multiple pages.
- Use the save(filename, format) method to write the PDF file.
Copy the code below into your file.

Convert VSDX to PDF in Node.js
Node.js library to convert VSDX to PNG
Follow these steps to convert a VSDX file to PNG programmatically:
- Use the Diagram() constructor to load a VSDX file.
- Create a new ImageSaveOptions(saveFormat) instance to set additional options.
- Adjust image resolution and brightness with setResolution() and setImageBrightness().
- Call the save(filename, format) method to generate the PNG file.
The code snippet below performs the conversion.

VSDX to PNG in Node.js
Get a Free License
Select a free temporary license to use Aspose.Diagram for Node.js without evaluation limits.
Summing up
We have shown how to convert VSDX to PDF in Node.js programmatically and how to convert VSDX to PNG instantly with Aspose.Diagram for Node.js. Explore the documentation for more features. Visit conholdate.com for additional topics and stay connected for updates.
Ask a question
If you have any queries, feel free to write to us on the forum.