Hi,
Workbook workbook = new Workbook(filepath);
WorksheetCollection worksheetCollection = workbook.getWorksheets();
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.setImageFormat(getImageFormat(ImageFormat.getPng());
imgOptions.setOnePagePerSheet(onePagePerSheet);
imgOptions.setHorizontalResolution(150);
imgOptions.setVerticalResolution(150);
imgOptions.setOnlyArea(areaOnly);
for (int i = 0; i < worksheetCollection.getCount(); i++) {
Worksheet worksheet = worksheetCollection.get(i);
SheetRender sr = new SheetRender(worksheet, imageOrPrintOptions);
for (int j = 0; j < sr.getPageCount(); j++) {
String imageFilePath = FileUtils.getAbsoluteFilePath(destinationFilePrefix + (noOfImages++), configurationInfo.getPreviewType().getType());
sr.toImage(j, imageFilePath);
}
}