This simple topic explains how to convert Excel to HTML in Node.js by accessing the source XLSX file from the disk and then exporting it as an HTML. Different properties of the output HTML file can be configured before you export Excel to HTML in Node.js like image format, setting the encoding, and flag to display the grid lines. The output file can be saved as an HTML as file or stream or even sent as an HTTP response if required.
Steps to Convert Excel to HTML in Node.js
- For converting Excel to HTML, configure the IDE to use Aspose.Cells for Node.js via Java
- Open the source Excel file that is to be converted to an HTML using the Workbook class instance
- Instantiate the HtmlSaveOptions object to set the options for the output HTML file
- Configure some properties of HTML like encoding, image format, and grid display
- Save the generated HTML file on the disk using the save options
The aforementioned steps have entailed the process to example the sample XLSX to HTML in Node.js by accessing it using an instance of the Workbook class and then configuring the desired HTML file. The configuration may include a number of HTML settings and is required while saving the output on the disk.
Code to Export Excel to HTML in Node.js
In order to perform conversion of Excel to Html Node.js code contains very few API calls where the XLSX file is accessed using an instance of the Workbook class and saved as HTML. There are several other parameters that can be used to set the output HTML, including image format, encoding, default font, grid display, excluding unused styles to reduce the size, and a number of other parameters. The generated HTML can be saved on the disk or inside a stream.
This topic has covered, how to convert Excel to HTML in Node.js. If you are interested in converting an Excel file to an SVG image, refer to the article on how to convert Excel to SVG in Node.js.