// Excel to PNG in Nodejs var aspose = aspose || {}; aspose.cells = require("aspose.cells"); // Create an object of the workbook class and load the source XLSX file. var wb = new aspose.cells.Workbook("sample.xlsx"); // Instantiate an instance of the ImageOrPrintOptions class to access specific image creation options. var imageOptions = new aspose.cells.ImageOrPrintOptions(); // Set Horizontal resolution by calling the setHorizontalResolution method. imageOptions.setHorizontalResolution(300); // Invoke the setVerticalResolution method to set Vertical Resolution. imageOptions.setVerticalResolution(300); // Set the font style by calling the setDefaultFont method. imageOptions.setDefaultFont("MS Gothic"); // Call the setOptimized method, set the value to true to optimize the output elements. imageOptions.setOptimized(true); // If value of the OnePagePerSheet method is true , all content of one sheet will output to only one page in result. imageOptions.setOnePagePerSheet(true); // Set the image's quality by invoking the setQuality method. imageOptions.setQuality(100) // The get(index) method will access the first worksheet in the workbook. var Worksheet = wb.getWorksheets().get(0); // Call the constructor of the SheetRender class for the target sheet. var sheetRender = new aspose.cells.SheetRender(Worksheet, imageOptions); // Now, loop through the pages and invoke the toImage method to create image for the sheet. for (var j = 0; j < sheetRender.getPageCount(); j++) { sheetRender.toImage(j, "ExcelToTIFF" + j + ".tiff"); }