Convert Excel to SVG in Node.js

Convert Excel to SVG in Node.js

Recently, we published a blog post that converts Excel files to XML programmatically. In this blog post, we will learn how to convert Excel to SVG in Node.js programmatically. However, this Node.js Excel library will be used to build an Excel to SVG converter in a JavaScript application. This article will help you in automating the Excel to SVG conversion process using a few lines of source code in Node.js. In fact, we will write a code snippet to demonstrate the functionality.

The following topics shall be covered in this article:

JavaScript Excel library installation

This Node.js Excel library is rich-featured and offers complete documentation regarding installation and its usage. So, run the following commands to install this API in your Node.js project.

npm install java
npm install aspose.cells

The second option is to download the API package and enable this library in your Node.js project.

Convert Excel to SVG in Node.js

Sometimes you do not have the MS Excel installed in your system and unable to access the data files. Therefore, it is important to convert Excel to SVG so that files can be viewed easily.

You may follow the following steps to perform Excel to SVG conversion programmatically:

  1. Create a Workbook object and load the source file.
  2. Initialize an instance of the ImageOrPrintOptions class to access additional image creation options.
  3. Convert each worksheet into SVG format in a single page by calling setSaveFormat method.
  4. Invoke this setOnePagePerSheet method to put all content of one sheet to only one page.
  5. Convert each worksheet into svg format by calling SheetRender method.
  6. Call this toImage method to output the worksheet into Svg image format.

You can see the output in the image below:

Excel file to SVG

Get a Free License

You can get a free temporary license to try the API beyond evaluation limitations.

Summing up

We are ending this blog post here. You have learned how to convert Excel to SVG in Node.js programmatically. In addition, we have enlisted all the steps that demonstrate the API methods. Moreover, you may visit documentation of this Node.js Excel library to know other prominent features. Further, you may check the “See Also” section below for relevant articles. Finally, please visit conholdate.com for the latest updates.

Ask a question

You can let us know about your questions or queries on our forum.

FAQs

Can you export Excel as SVG?

You can install this JavaScript Excel library to export Excel file to SVG file format. This setSaveFormat method converts Worksheets into SVG format programmatically.

What programs can convert to SVG?

Copy & paste this code snippet into your main file that converts Excel to SVG programmatically.

See Also