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.

Tue Jul 06, 2021 2:01 pm

Hi!
I need to convert word and excel files to PDF and I try
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.doc.free</artifactId>
<version>3.9.0</version>
</dependency>
<dependency>
<groupId>e-iceblue</groupId>
<artifactId>spire.xls.free</artifactId>
<version>3.9.2</version>
</dependency>

First was fine.
But for excel
Workbook workbook = new Workbook();
workbook.loadFromFile("1.xlsx");
workbook.getConverterSetting().setSheetFitToPage(true);
workbook.saveToFile("ExcelToPDF.pdf", FileFormat.PDF);
..
I get error for new Workbook(): Exception in thread "main" java.lang.NoSuchMethodError: com.spire.pdf.PdfPaddings.spr (Ljava/lang/String;)Ljava/lang/String;

What's wrong?
Attachments
toPdf.zip
(16.27 KiB) Downloaded 342 times

trushinov
 
Posts: 5
Joined: Tue Jul 06, 2021 1:43 pm

Wed Jul 07, 2021 8:16 am

Hello,

Thanks for your inquiry.
Kindly note the Spire.Doc and Spire.XLS are two independent products, they can't be used together in a same project due to the incompatible. To avoid this issue, please use our Spire.Office, which contains Spire.Doc, Spire.XLS and our other Java components. Please change your pom setting as below.
Code: Select all
<dependency>
    <groupId>e-iceblue</groupId>
    <artifactId>spire.office.free</artifactId>
    <version>3.9.0</version>
</dependency>

By the way, our free version has some limitations and we don't upgrade the free version regularly. Hence, I suggest that you download our commmercial version, which has no limitations and conatins more fixes and new features than the free one. To help you better evaluate our commercial version without any watermarks or restrictions, we are willing to provide you with a one-month temporary license.You can apply for temporary license from this link: https://www.e-iceblue.com/Download/office-for-java.html. If there is any question, please feel free to write back.
Code: Select all
<dependency>
     <groupId>e-iceblue</groupId>
     <artifactId>spire.office</artifactId>
     <version>4.6.6</version>
</dependency>

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Wed Jul 07, 2021 10:15 am

Thanks, Annika!
This problem solved with spire.office.free.

After some tests our company plans to get com.version
But now we get some problems with hard old styled doc-files conversion. Looking for a compromise.. :-)

trushinov
 
Posts: 5
Joined: Tue Jul 06, 2021 1:43 pm

Wed Jul 07, 2021 11:00 am

Hello,

Thank you for your feedback.
Regarding the old styled doc-files conversion issues, please provide your Word file, testing code and detailed information about the error you faced, then we will do investigations and provide corresponding solution for you. You could attach them here or send to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Wed Jul 07, 2021 12:09 pm

Hello, Annika!

Doc-files conversion is not main problem now.
For excel I have a trouble for xlsx from stream: nested exception is class com.spire.office.packages.sprIwD: Unknown char: .
The same xsl (old format) conversion - no problem. Try both spire.office.free and spire.office

Code: Select all
    public ResponseEntity<Resource> getPdfFromExcel(InputStream is) {
        // Create a Workbook ToDo: https://www.e-iceblue.com/forum/convert-excel-to-pdf-problem-t10338.html
        Workbook workbook = new Workbook();
        workbook.loadFromStream(is);
        // Fit to page
        workbook.getConverterSetting().setSheetFitToPage(true);
        // Выходной PDF-поток
        ByteArrayOutputStream bos = new ByteArrayOutputStream();

        workbook.saveToStream(bos, com.spire.xls.FileFormat.PDF);
        return getResource(bos, "pdfFile-FromExcel");
    }


Excel files in attachment may disappear :-( - our corp.network restrictions
Attachments
excels.zip
(32.4 KiB) Downloaded 366 times

trushinov
 
Posts: 5
Joined: Tue Jul 06, 2021 1:43 pm

Thu Jul 08, 2021 8:44 am

Hello,

Thank you for your sharing.
I tested the "01.xlsx" file, indeed faced an exception ("Invalid pivot table data source"). I have logged the issue into our Bug tracking system with the ticket number SPIREXLS-3332. Our development team will investigate and fix it. Once it is resolved, I will inform you. Sorry for the inconvenience caused.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Thu Jul 08, 2021 6:01 pm

Annika, I get another trouble - now with DOCX conversion (using spire.office-4.6.6.jar).
document.saveToStream: java.lang.NumberFormatException: For input string: "-2,09"

Code: Select all
        Document document = new Document();
        document.loadFromStream(is, FileFormat.Auto);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        document.saveToStream(bos, FileFormat.PDF);


This file converted with org.docx4j almost normally.
What's wrong now?
Attachments
Zay_Ank2.zip
(49.1 KiB) Downloaded 348 times

trushinov
 
Posts: 5
Joined: Tue Jul 06, 2021 1:43 pm

Fri Jul 09, 2021 3:15 am

Hello,

Thank you for your sharing.
I tested your case with the same version of Spire.Office, but did not reproduce your problem on my side. Please provide the following information to help us investigate your issue quickly and effectively. Thanks in advance.
1) Your test environment, such as OS info (E.g. Windows7, 64bit) and region setting (E.g. China, Chinese).
2) Your JDK version, such as 1.8.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Fri Jul 09, 2021 4:12 am

My test environment: Windows 10 Pro 2004 64 bit, Russia, JDK 13.0.1

trushinov
 
Posts: 5
Joined: Tue Jul 06, 2021 1:43 pm

Fri Jul 09, 2021 10:32 am

Hello,

Thank you for your sharing.
I tested your case in the same environment, and indeed encountered the same exception as yours. I have logged the issue into our bug tracking system with the ticket number SPIREDOC-6335. Our development team will investigate and fix it. Once it is resolved, I will inform you. Sorry for the inconvenience caused.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Wed Aug 04, 2021 10:57 am

Hello,

Thanks for your patience.
Glad to inform you that we just released the latest version of Spire.Office For Java v4.8.0. It contains the fix for your problem SPIREDOC-6335. Please download it from the following links.
Website link:
https://www.e-iceblue.com/Download/office-for-java.html
Maven link:
https://repo.e-iceblue.com/nexus/conten ... ice/4.8.0/

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Thu Sep 09, 2021 10:16 am

Hello,

Thanks for your patience.
Glad to inform you that we just released the latest version of Spire.Office For Java v4.9.2. It contains the fix for your problem SPIREXLS-3332. Please download it from the following links.
Website link:
https://www.e-iceblue.com/Download/office-for-java.html
Maven link:
https://repo.e-iceblue.com/nexus/conten ... ice/4.9.2/

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1648
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.XLS