We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

.ppt converted to empty pdf by Aspose.Cells

The attached a.ppt presentation can be loaded and converted to .pdf by Aspose.Cells without it throwing any expection. It silently produces an empty .pdf.



This is most disturbing: one would expect the library to detect formats that are not allowed and inform the caller by throwing an exception.

Hi Mario,

Thanks for your posting and using Aspose.Cells.

We tested this issue with the following code using the latest version: Aspose.Cells
for Java v8.0.0.1
and it worked fine and threw the exception.

Please download and use the latest version for your needs.

Java


String filePath = “F:\Shak-Data-RW\Downloads\a.ppt”;


Workbook workbook = new Workbook(filePath);

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

Exception:
Exception in thread "main" com.aspose.cells.CellsException: This is a PowerPoint file.
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at ClsAsposeTest.f1(ClsAsposeTest.java:244)
at ClsAsposeTest.main(ClsAsposeTest.java:33)

Hi,



I checked with 8.0.0.1, but nothing changes.



I’m using the Workbook(InputStream) rather than the Workbook(String) constructor.



I guess that the exception is thrown by your example because the constructor you are using can check the filename extension.



With the constructor I’m using such information is missing. The constructor should check the content rather than merely check a file extension.



Here is the code, where bytes is a byte[] containing all the a.ppt bytes.



ByteArrayOutputStream bout = new ByteArrayOutputStream();

Workbook workbook = new Workbook(new ByteArrayInputStream(bytes));

workbook.save(bout, com.aspose.cells.SaveFormat.PDF);

return bout.toByteArray();

Hi Mario,

Thanks for your feedback and using Aspose.Cells.

You are right. When the Workbook constructor with stream parameter is used, then Aspose.Cells could not detect the file and converts it to empty pdf. I have tested this issue 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-40784.

I have attached the output pdf for a reference.

Java


String filePath = “F:\Shak-Data-RW\Downloads\a.ppt”;


FileInputStream fin = new FileInputStream(filePath);


Workbook workbook = new Workbook(fin);


workbook.save(filePath + “.out.pdf”, com.aspose.cells.SaveFormat.PDF);

Hi,



thanks for your efforts in the investigation.



I hope to see the bug corrected in the near future.



Best regards

Hi,


We have worked over your issue, it is figured out. Hopefully, we will provide the fix before the end of next week here after some extensive testing and incorporating other enhancements.

Thank you.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Thanks for the wonderful speed of your updates cycle!

Hi,


You are welcome. Hopefully, the new version/fix will work fine accordingly for your needs. Feel free to contact us any time if you have further comments or find any other issue or queries, we will be glad to help you soon.

Have a nice day!