How to Convert Excel to TIFF in Node.js

How to Convert Excel to TIFF in Node.js

We have an efficient solution for you if you are looking to build an Excel to TIFF converter programmatically. Excel to TIFF conversion in a Node.js-based application is not a difficult task now. However, you may install this Node.js Excel library in your project and start writing source code to convert XLSX files to other file formats. By the end of this tutorial, you should know how to convert Excel to TIFF in Node.js programmatically.

We will cover the following topics in this blog post:

Node.js Excel library installation

This is a crucial step for every developer as any issue during the installation may affect your development time. However, it lets you download the API package or install it by running the following commands:

npm install java
npm install aspose.cells

How to Convert Excel to TIFF in Node.js

There are many methods exposed by this library that you can meet your business requirements easily.

Following are the steps to build an Excel to TIFF programmatically:

  1. Create an object of the Workbook class and load the source XLSX file.
  2. Instantiate an instance of the ImageOrPrintOptions class to access specific image creation options.
  3. Set Horizontal resolution by calling the setHorizontalResolution method.
  4. Invoke the setVerticalResolution method to set Vertical Resolution.
  5. Set the font style by calling the setDefaultFont method.
  6. Call the setOptimized method, and set the value to true to optimize the output elements.
  7. If the value of the OnePagePerSheet method is true, all content of one sheet will output to only one page in the result.
  8. Set the image’s quality by invoking the setQuality method.
  9. The get(index) method will access the first worksheet in the workbook.
  10. Call the constructor of the SheetRender class for the target sheet.
  11. Now, loop through the pages and invoke the toImage method to create an image for the sheet.

Copy & paste the following code into your main file:

The output can be seen in the image below:

Excel to TIFF

Get a Free License

You can avail a free temporary license to try the API without evaluation limitations.

Summing up

We are ending this article here with the hope that you have learned how to convert Excel to TIFF in Node.js programmatically. Moreover, there are other relevant blog posts enlisted in the “See Also” section that you may check out. Finally, please visit the documentation of this Node.js Excel library to know the other interesting 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.

FAQs

Can you save Excel as a TIFF?

Yes, you can convert an Excel to a TIFF image using this Node.js Excel library. This library offers a wide range of methods to convert Excel files to other file formats programmatically.

See Also