Hi there,
I’m using 22.7 version.
I’m trying to convert the 2.zip (3.7 MB)
file with the following code -
public static byte[] convertExcelToPDF(ByteArrayInputStream excelInputStream) throws Exception {
ByteArrayOutputStream outputStreamPdf = new ByteArrayOutputStream();
try {
LOGGER.info("Initiating Excel to pdf conversion");
Workbook workbook = new Workbook(excelInputStream);
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setAllColumnsInOnePagePerSheet(true);
workbook.save(outputStreamPdf, saveOptions);
LOGGER.info("Conversion from Excel to pdf completed");
return outputStreamPdf.toByteArray();
} catch (Exception ex) {
LOGGER.info("Exception occurred while converting Excel to pdf : ", ex);
throw ex;
} finally {
outputStreamPdf.close();
}
}
Now, here’s the situation -
It works on my Windows machine.
It throws the following error on our dev environment -
{
"message": "org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.aspose.cells.i72"
}
Please help!