Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Fri Apr 30, 2021 9:56 pm

Hello!
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?
Attachments
excel and pdf files.zip
(382.49 KiB) Downloaded 180 times

Tesla_19
 
Posts: 2
Joined: Fri Apr 30, 2021 8:39 pm

Mon May 03, 2021 6:42 am

Hello,

Thanks for your inquiry.
Regarding the errors you got when converting the two files "1.xls" and "5.xls", it has been fixed in the latest Free Spire.XLS for Java Version:3.9.1. Please download this version and try again.

As for the other files, I have reproduced your issue and logged it in our bug tracking system with the ticket SPIREXLS-3237. We will let you know if there is any update. Sorry for the inconvenience caused.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon May 03, 2021 12:58 pm

Hello!
Maven doesn't find version 3.9.1

Code: Select all
    <repositories>
        <repository>
            <id>com.e-iceblue</id>
            <name>e-iceblue</name>
            <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>e-iceblue</groupId>
            <artifactId>spire.xls.free</artifactId>
            <version>3.9.1</version>
        </dependency>
    </dependencies>


What can I do wrong ?

Tesla_19
 
Posts: 2
Joined: Fri Apr 30, 2021 8:39 pm

Tue May 04, 2021 2:32 am

Hello,

Thanks for your response.

I'm sorry that the latest version of Free Spire.Xls in our maven repository is 3.9.2, modify your pom.xml file as shown below. If you have any other questions, just feel free to contact us.
Code: Select all
    <repositories>
        <repository>
            <id>com.e-iceblue</id>
            <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
        </repository>
    </repositories>
    <dependencies>
    <dependency>
        <groupId> e-iceblue </groupId>
        <artifactId>spire.xls.free</artifactId>
        <version>3.9.2</version>
    </dependency>
    </dependencies>


Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon May 24, 2021 11:10 am

Hello,

Thanks for your patience.
Glad to inform you that we just released Spire.XLS for Java Version:4.5.3 which fixes the issue SPIREXLS-3237. Welcome to download it from the following links.
Our website: https://www.e-iceblue.com/Download/xls-for-java.html
Maven: http://repo.e-iceblue.com/nexus/content ... xls/4.5.3/

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.XLS