Excel can only be rendered as JPEG

Using the code below, I should be able to create a BMP file from an Excel worksheet, but in fact it only works for the JPEG case. All other file formats fail. I am using aspose-cells-7.0.3-java.

void test() throws Exception {
m_workbook = new Workbook("C:\\Users\\Bruce\\Desktop\\PFI_test_cases.xlsx");
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.setHorizontalResolution(118);
options.setVerticalResolution(112);
options.setImageFormat(ImageFormat.getBmp());
options.setOnePagePerSheet(true);
options.setImageFitToPage(true);
Worksheet worksheet = m_workbook.getWorksheets().get(0);
SheetRender render = new SheetRender(worksheet, options);
FileOutputStream outputStream = new FileOutputStream("C:\\Users\\Bruce\\Desktop\\Test.bmp");
render.toImage(0, outputStream);

}

Hi,


I can find the issue: “Exception in thread “main” java.lang.UnsupportedOperationException: setPosition() is not supported. …” when using your code with a simple template file.

I have logged a ticket with an id: CELLSJAVA-40046. We will look into it soon.

Thank you.
Hi,

Please try the attached version/fix: v7.0.3.3.

We have fixed the issue.


Thank you

The issues you have found earlier (filed as CELLSJAVA-40046) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.