Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Jul 20, 2023 11:48 am

Dear support team,

I have a problem with the attached Word document. If the document is loaded and should be saved with a new name, I got the following exception:

Code: Select all
Exception in thread "main" com.spire.doc.packages.sprdcv: Value was either too large or too small for an Int32.
   at com.spire.doc.packages.sprfdw.spr┏…—(Convert.java:878)
   at com.spire.doc.packages.sprfdw.spr⅓…—(Convert.java:861)
   at com.spire.doc.packages.sprfsz.spr‰┎—(Unknown Source)
   at com.spire.doc.packages.sprjlaa.spr⅙┥—(Unknown Source)
   at com.spire.doc.packages.sprjlaa.spr▓┥—(Unknown Source)
   at com.spire.doc.packages.sprmiaa.spr㈬⃝┑—(Unknown Source)
   at com.spire.doc.packages.sprmiaa.spr⇇“—(Unknown Source)
   at com.spire.doc.documents.Paragraph.spr┲‼—(Unknown Source)
   at com.spire.doc.DocumentObject.spr╗‼—(Unknown Source)
   at com.spire.doc.documents.Paragraph.spr┚‰—(Unknown Source)
   at com.spire.doc.DocumentObject.spr℃‰—(Unknown Source)
   at com.spire.doc.DocumentObject.spr╗‼—(Unknown Source)
   at com.spire.doc.TableCell.spr┚‰—(Unknown Source)
   at com.spire.doc.DocumentObject.spr℃‰—(Unknown Source)
   at com.spire.doc.DocumentObject.spr╗‼—(Unknown Source)
   at com.spire.doc.TableRow.spr┚‰—(Unknown Source)
   at com.spire.doc.DocumentObject.spr℃‰—(Unknown Source)
   at com.spire.doc.DocumentObject.spr╗‼—(Unknown Source)
   at com.spire.doc.Table.spr┚‰—(Unknown Source)
   at com.spire.doc.DocumentObject.spr℃‰—(Unknown Source)
   at com.spire.doc.DocumentObject.spr╗‼—(Unknown Source)
   at com.spire.doc.Body.spr┚‰—(Unknown Source)
   at com.spire.doc.packages.sprmiaa.spr┒┤—(Unknown Source)
   at com.spire.doc.packages.sprrkaa.spr┺┑—(Unknown Source)
   at com.spire.doc.packages.sprrkaa.spr▏├—(Unknown Source)
   at com.spire.doc.packages.sprmiaa.spr■┄(Unknown Source)
   at com.spire.doc.packages.sprdlaa.spr┺┑—(Unknown Source)
   at com.spire.doc.packages.sprdlaa.spr┡“(Unknown Source)
   at com.spire.doc.packages.sprdlaa.spr▂├—(Unknown Source)
   at com.spire.doc.packages.sprdlaa.spr┥┤—(Unknown Source)
   at com.spire.doc.Document.spr⁆╀—(Unknown Source)
   at com.spire.doc.Document.saveToFile(Unknown Source)
   at ...


I've simplified the code as much as possible and in essence there are only 2 lines left to reproduce the problem:

Code: Select all
   Document document = new Document("Test.docx");
   document.saveToFile("Test.generated.docx", FileFormat.Docx);


If the document is saved using PDF file format, everything works fine.

I use the most current version of Spire.Doc for Java.

Any ideas how to solve the problem?

Kind regards,
Marcus

mgattinger
 
Posts: 65
Joined: Fri May 21, 2021 9:03 am

Fri Jul 21, 2023 2:19 am

Hi Marcus,

We appreciate your feedback and would like to assist you in resolving this matter.

I have tested the latest version of Spire.Doc for Java along with the code and document you provided, and I did not encounter any exceptions or issues with the resulting document. This suggests that the problem may be specific to your environment.
test.png

To better understand the situation, could you please confirm if you are using the latest version 11.7.0? If not, we recommend upgrading to the latest version as it may contain fixes or improvements related to the issue you are experiencing.

However, if you are already using the latest version and the problem persists, we kindly request you to provide us with information about your testing environment. Specifically, please let us know the following details:

1. Operating System: (e.g., Windows 10 64-bit)
2. Regional Settings: (e.g., China, Chinese)
3. JDK Version

Thank you for your cooperation, and we look forward to your response.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Fri Jul 21, 2023 6:44 am

Here are the information you have requested:
- Spire.Doc for Java: 11.7.0
- Operating System: Windows 11 Business, Version 22H2, 64-bit
- Regional Settings: Deutsch (Deutschland)
- JDK Version: openjdk version "20" 2023-03-21
OpenJDK Runtime Environment (build 20+36-2344)
OpenJDK 64-Bit Server VM (build 20+36-2344, mixed mode, sharing)

mgattinger
 
Posts: 65
Joined: Fri May 21, 2021 9:03 am

Fri Jul 21, 2023 7:26 am

Hi,

Thanks for your sharing.
After conducting further investigations, I was able to reproduce the problem by setting my regional settings to Germany. I have recorded this issue into our issue tracking system with the ticket number SPIREDOC-9692. Our development team will investigate and fix it. Once the issue is fixed, I will inform you asap.

In the meantime, as a temporary workaround, you can add the following line of code to your application:

Code: Select all
Locale.setDefault(Locale.ROOT);

We apologize for any inconvenience caused and greatly appreciate your patience and understanding. Should you have any further questions or concerns, please feel free to reach out to us. We are here to assist you.
Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Fri Jul 21, 2023 9:39 am

I'm glad you are able to reproduce the exception. Thank you for the workaround. I tested it and it works.

Please inform me as soon as the new version of Spire.Doc for Java is available that will fix this bug.
Thank you!

Kind regards,
Marcus

mgattinger
 
Posts: 65
Joined: Fri May 21, 2021 9:03 am

Fri Jul 21, 2023 9:47 am

Hi Marcus,

Thanks for your feedback.
Once the issue is fixed, I will inform you asap. Thanks for your unstanding and corporation. If you have any other questions, jsut feel free to contact us. we are here to assist you.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Doc