Dear sir,
When converting a specific excel to a PDF we've encountered an error.
(unfortunately, this exception isn't thrown by Aspose, so we couldn't catch it)
com.aspose.cells.CellsException: This file's format is not supported or you don't specify a correct format.
We've created the Excel file by importing a CSV file, and then saving it as an xls file (using MS Excel 2016). However when saving the spreadsheet as xlsx, everything seems to work fine.
try {
Workbook doc = new Workbook("dir to excel.xls"');
PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.setEmbedStandardWindowsFonts(true);
doc.save(dir_to_output.pdf , saveOptions);
} catch (Exception e) {
Logger.error("Cells to PDF Transformation failed", e);
...
}
using : Java Aspose Cells 8.8.3
Java version : 1.7
Could you please look into this issue?
I've attached the xls file in this post.
Friendly regards,
Samnang
Hi,
Thanks for the template file and some details.
Well, your underlying template Excel file is of type e.g “Microsoft Excel 5.0/95 Workbook”. This is an older Excel file format which is not supported by Aspose.Cells, so, you are getting this exception for the file. For your information, Aspose.Cells supports BIFF8 or greater formats (Excel 97 - Excel 2010/2013, Excel 2016). To confirm this is “Microsoft Excel 5.0/95 Workbook” file, you may try to open your file into MS Excel 2003/2007 and try to Save it As, now you can see the save as type something like i.e. “Microsoft Excel 5.0/95 Workbook” in the Save As dialog box.
To workaround your issue, you may try the following steps to work with the file for Aspose.Cells APIs, so that Aspose.Cells could open/process the file fine. And, I am afraid, there is no other way around.
e.g
Open your template file(s) into MS Excel (e.g…,Ms Excel 2003 or 2007).
Save the file As “Microsoft Office Excel Workbook”.
Now you can use Aspose.Cells to open/manipulate or render the files for your requirements.
Thank you.