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.

Sun Jan 15, 2023 11:18 pm

Greetings,

I've been using the free version of Spire.Doc to convert from .Doc to .Pdf. The identical application seems to work on one server, but not on another. But are running Ubuntu 20.04.

At first I got an exception:

Code: Select all
java.lang.NoSuchMethodError: 'com.spire.license.Assembly com.spire.license.LicenseProvider.validateVarAndGetInfo(java.lang.String)'
   at com.spire.doc.Document.spr   (Unknown Source)
   at com.spire.doc.Document.<init>(Unknown Source)


But for some reason, I haven't seen this exception again.
I searched for the error and found a thread saying two spire products can't co-exist in the same project, I was using spire.xls and spire.doc (they seem to coexist on my project on another server though). So I switched to spire.office instead in the pom.xml. But this didn't help.

The code i'm using is following, it should transform a .doc to .pdf and let me download it, but it only saves a 0 byte .pdf file.
Code: Select all
FileOutputStream outTmpStream = null;
      com.spire.doc.Document document = new com.spire.doc.Document();
      
      try {
           String tmpPath = System.getProperty("java.io.tmpdir") +
               "/tmp_pdf_export_"+ (int) Math.round(Math.random()*100000);
         String outDocFilePath =  tmpPath + ".doc";
         outTmpStream = new FileOutputStream(outDocFilePath);
         doc.write(outTmpStream);
         outTmpStream.close();
         doc.close();

         document.loadFromFile(outDocFilePath);

         document.saveToStream(out, FileFormat.PDF);



What could be causing this? Does the free version have some restrictions for example about the number of subdomains it can be used on?

Thanks

asdfasfa
 
Posts: 4
Joined: Tue Jan 05, 2021 12:34 pm

Mon Jan 16, 2023 3:22 am

Hello,

Thanks for your inquiry.
To help us reproduce your issue and work out a solution for you, please offer the following message. Thanks for your assistance in advance.
1) Your input word document, you can attach here or send it to us via email ([email protected]).
2) The Jdk you used, such as Oracle Jdk 1.8.

For the Free for Spire.Doc, it is limited to 500 paragraphs and 25 tables. This limitation is enforced during reading or writing files. When converting word documents to PDF and XPS files, you can only get the first 3 pages of PDF file. Upgrade to Commercial Edition of Spire.Doc for Java.We don't provide technical or any other support to the users of the free versions. If your document exceeds the limitation, I suggest you can use our commercial version (the latest version of Spire.Doc is V11.1.1), and we are willing to provide a temporary license (one month free) to help you remove the warning message. If you need it, you can contact our sales team([email protected]).

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Wed Jan 18, 2023 3:24 pm

Hey,

Uploaded the template used
The application is compiled on 1.8, the server runs on opendjk 11.0.17

Also the problem could have something to do with the change from Ubuntu 20.04 to Ubuntu 22.04. So on the 20.04 server it worked on 22.04 it doesn't

asdfasfa
 
Posts: 4
Joined: Tue Jan 05, 2021 12:34 pm

Thu Jan 19, 2023 10:41 am

Hello,

Thanks for your feedback.
Due to Ubuntu22.04 is not installed in my test environment, I need some time to install it, please share us some time to do investigation, and I’ll do investigation and write back to you asap. Sorry for the inconvenience caused.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Fri Jan 20, 2023 9:54 am

Hello,

Thanks for your patiently waiting.
I tested the scenario in Ubuntu 22.04, but I didn’t reproduce your issue and I can get the result pdf document, I attached the result pdf document for your reference. In addition, I put my test jar file and input file to our server. You can download it from the following link and test it on your side.

https://www.e-iceblue.com/downloads/demo/32059Test.zip

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.Doc