Invalid print quality error opening Excel 2007 file using Java

Hello. I'm an Aspose.Cells for .NET user who is currently evaluating the Java version for a separate project. I am trying to open one of my production files, but Aspose is throwing the following exception:

Exception in thread "main" java.io.IOException: It is not a valid excel2007 file.Invalid print quality.It must be greater than 0.

at com.aspose.cells.Workbook.open(Unknown Source)

at Open2007.main(Open2007.java:16)

The 2003 version of the same file opens fine in Java, and this particular 2007 file opens fine using Aspose.Cells for .NET.

After lots of trial and error, I determined that if I open the Page Setup dialog for a particular worksheet in the workbook, simply click OK, and save, I can use the file from that point forward. The file is also "fixed" if I remove all header and footer information using Excel 2007's "Prepare/Inspect" functionality.

However, these are not acceptable solutions for the use case that my team is planning to implement. Any thoughts here?

Thanks.

--Scott McMaster

Hi,

Thanks for considering Aspose.

Could you post your Excel 2007 file (.xlsx) here, we will check and figure out the issue ASAP (if found).

Which version of Aspose.Cells for Java you are using. Also, kindly make sure that the file is a native excel file.

Thank you.

Thanks, here it is.

Hi,

Thanks for providing us the template file.

We found the issue after an initial test. We will try to figure it out soon.

Thank you.

Hi,

Please try this attached fix. By the way, how do you get this excel file? Is it reated by MS Excel? The DPI value for print quality defined in this file is 0, but the MS Excel dose not provide this type option in print setup dialog. Currently we just ignore this invalid value for print quality.

That works, thanks. Will this be rolled up into a future "official" release of the library?

This is indeed an Excel-produced document. However, I believe some of the options in that dialog come from the selected printer. This file came from a machine with a different set of printers drivers than what I have installed. Maybe that has something to do with it.

Anyway, thanks again.

-scott

Hi Scott,

Yes, our next official release of the product (Aspose.Cells for Java) would include this functionality.

Thank you.