In this blog post, the following points will be covered:
XLSX JS library installation
npm install java npm install aspose.cells
How to Convert Excel to JPG in Node.js
There is a huge stack of features offered by this rich-featured library. Now, you can start writing code to build an Excel to JPG converter programmatically.
Please follow the steps given below:
- Initialize an instance of the Workbook class and load the source file.
- Create an object of the ImageOrPrintOptions class to access specific image creation options.
- Call the setImageType method to set the image type.
- The get(index) method will access the first worksheet in the workbook.
- Initialize the constructor of the SheetRender class for the target sheet.
- Loop through the pages and invoke the toImage method to create images for the sheets.
Copy & paste the following code into your main file:
The output can be seen in the image below:
Get a Free License
You can avail a free temporary license to try the API without evaluation limitations.
To sum up, you have learned how to convert Excel to JPG in Node.js programmatically. This article will surely help you if you are looking to develop an Excel to JPG conversion module using this XLSX JS library. Moreover, you may visit the documentation to explore other features.
Moreover, we suggest you follow our Getting Started guide.
Finally, conholdate.com is writing new blog posts. So, please stay in touch for regular updates.
Ask a question
You can let us know about your questions or queries on our forum.
How do I convert Excel to image?