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

Free Support Forum - aspose.com

Error while saving the workbook


While trying to get PDF of one of the sheets in the workbook, following exception is being thrown by Aspose:
Exception in thread “main” com.aspose.cells.CellsException: End of file reached.
at com.aspose.cells.bie.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.save(Unknown Source)
at com.quark.qpp.office.service.TestAspose.getSheetPdf(TestAspose.java:150)
at com.quark.qpp.office.service.TestAspose.main(TestAspose.java:58)

However, I am able to save this sheet as PDF from MS Excel.

I have attached the Excel file being used for your reference and the PDF generated from MS Excel.

Following is the code snipped being used:

Workbook workbook = new Workbook(excelFilepath);
WorksheetCollection ws = workbook.getWorksheets();

for (int i = 0; i < ws.getCount(); i++) {
String sname = ws.get(i).getName();

PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();

workbook.save(excelFilepath+".pdf", pdfSaveOptions);


Hi Neeraj,

Thank you for providing your sample spreadsheet and code snippets.

We have evaluated your presented scenario while using the latest version of Aspose.Cells for Java, and we are able to replicate the said exception on our end. In order to further investigate the matter, and to provide a fix, we have logged a ticket with Id CELLSJAVA-40985 in our bug tracking system. Please spare us little time to properly analyze the problem cause, and to provide a fix (if applicable). In the meanwhile, we will keep you posted with updates in this regard.

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

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

Thanks. Its working fine now.



Thanks for your feedback.

Good to know that it figures out your issue now. Feel free to write back if you have further comments or questions, we will be happy to assist you soon.

Thank you.