I try to use spire.xls.free (version 2.2.0) for converting from excel to pdf and have some problem.
If I convert any excel file then I always see exception in log:
- Code: Select all
java.lang.NullPointerException
at com.spire.xls.packages.sprWXa.spr (Unknown Source)
at com.spire.xls.packages.sprWXa.spr (Unknown Source)
at com.spire.xls.packages.sprWXa.spr (Unknown Source)
at com.spire.xls.packages.sprWXa.<init>(Unknown Source)
at com.spire.xls.packages.sprsra.<init>(Unknown Source)
at com.spire.xls.packages.sprKra.<init>(Unknown Source)
at com.spire.xls.core.spreadsheet.XlsWorkbook.<init>(Unknown Source)
at com.spire.xls.Workbook.<init>(Unknown Source)
But despite of exception pdf file was created.
I use the following code:
- Code: Select all
Workbook workbook = new Workbook();
workbook.loadFromFile("1.xls");
workbook.saveToFile("1.pdf",FileFormat.PDF);
I attached several example with excel files and pdf files after converting. (attached file: excel and pdf files.zip)
1.xls was converted normal to 1.pdf.
2.xls was converted with error to 2.pdf and we can't open 2.pdf.
3.xlsx was not converted.
4.xls was converted with error to 4.pdf and we can't open 4.pdf.
5.xls was converted normal to 5.pdf.
Why are errors? Why don't convert some files ? Can you fix this error?