Excel XLSM convert to PDF fails - Shape to image fatal exception - Java Cells

Hi,

When trying to convert the attached Excel document to PDF in Aspose Cells for Java versions 8.0.1 & 8.0.2 I get the following error;

com.aspose.cells.CellsException: Shape to image Error!

at com.aspose.cells.bgq.a(Unknown Source) ~[cells-8.0.1.jar:8.0.1.0]

at com.aspose.cells.Workbook.a(Unknown Source) ~[cells-8.0.1.jar:8.0.1.0]

at com.aspose.cells.Workbook.save(Unknown Source) ~[cells-8.0.1.jar:8.0.1.0]

Could someone please review the cause. The conversion code;

PdfSaveOptions saveOpts = new PdfSaveOptions();
saveOpts.setPrintingPageType(PrintingPageType.IGNORE_BLANK);
saveOpts.setOnePagePerSheet(worksheetsOnePage);
LoadOptions loadOpts = new LoadOptions();
loadOpts.setMemorySetting(MemorySetting.MEMORY_PREFERENCE);
Workbook doc = new Workbook(is, loadOpts); //input stream
PipedOutputStream os = new PipedOutputStream();
PipedInputStream data = new PipedInputStream(os);
doc.save(os, saveOpts);
os.close();

Hi,

Thanks for your posting and using Aspose.Cells.

It seems, your xlsm file is corrupt because if you open it in MS-Excel 2010, it shows warning “Excel found unreadable content. Do you want to recover the contents of this workbook”. However, it opens without warning on Excel 2007.

We were able to replicate this issue with the latest version: Aspose.Cells
for Java v8.0.2.3
with the following code.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once, the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as CELLSJAVA-40839.

Java


String filePath=“F:\Shak-Data-RW\Downloads\excel_tutorial.xlsm”;


Workbook workbook = new Workbook(filePath);

workbook.save(filePath + “.out.pdf”);


Exception:
Exception in thread "main" com.aspose.cells.CellsException: Shape to image Error!
at com.aspose.cells.bgu.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at ClsAsposeTest.f1(ClsAsposeTest.java:277)
at ClsAsposeTest.main(ClsAsposeTest.java:33)

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells
for Java v8.3.1.2
and let us know your feedback.

I have converted your Excel file into PDF using the latest version and attached it for your reference.