// Create a png file stream FileOutputStream outputStream = null; try { outputStream = new FileOutputStream("ExportSheetToImage.png"); } catch (FileNotFoundException e) { e.printStackTrace(); } // Create a new workbook Workbook workbook = new Workbook(); workbook.open(this.getResourceStream("xlsx/Home inventory.xlsx")); IWorksheet worksheet = workbook.getWorksheets().get(0); // Save the worksheet as image to a stream. worksheet.toImage(outputStream, ImageType.PNG); // Close the file stream try { outputStream.close(); } catch (IOException e) { e.printStackTrace(); }