We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

[Java] Docx to PDF conversion errors

Hello


When converting various Word (.docx) documents to PDF I get 2 kinds of exceptions:
  • NullPointerException
  • StackOverflowException
The code I’m using for the conversion:

Document document = new Document(inputFile);
document.save(outputFile);

System specs:
  • OS X 10.9
  • Java (build 1.8.0_20-b26)
  • Aspose.Words 14.5.0 (from Maven repository)

StackOverflowException stack trace (omitted rest of obfuscated code):

Exception in thread “main” java.lang.StackOverflowError
at java.util.regex.Pattern$Curly.match0(Pattern.java:4250)
at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4717)
at java.util.regex.Pattern$Curly.match0(Pattern.java:4247)
at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3798)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
at java.util.regex.Pattern$Branch.match(Pattern.java:4604)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
at java.util.regex.Pattern$Begin.match(Pattern.java:3525)
at java.util.regex.Matcher.search(Matcher.java:1248)
at java.util.regex.Matcher.find(Matcher.java:637)
at asposewobfuscated.zz2K.(Unknown Source)

Those exceptions always occur for the same files.

Hi Tomasz,


Thanks for your inquiry. Please upgrade to Aspose.Words for Java 14.8.0 and see how it goes on your end.

In case the problem still remains, please attach your input Word documents, you’re getting these problems with here for testing. We will investigate the issue on our end and provide you more information.

Best regards,

Sadly I cannot share the files.


Is Aspose mvn repo properly configured?
This is what I get when I try to download 14.8.

/Users/twojcik/.m2/repository/com/aspose/aspose-words/14.8.0
14.8.0 ➤ tree
.
├── _remote.repositories
├── aspose-words-14.8.0.jar.lastUpdated
├── aspose-words-14.8.0.pom
└── aspose-words-14.8.0.pom.sha1

I manually removed the .lastUpdated extension, however IntelliJ Idea still have problems with resolving Document class from the Aspose.Words jar.

Hi Tomasz,


Thanks for your inquiry. I have attached a sample “IntelliJ Idea” project here for your reference. Please download “AsposeWordsMavenTest.zip” and see how it goes on your end. I hope, this helps.

Secondly, please try downloading Aspose.Words for Java 14.8.0 from here and see if the exceptions still occur on your end or not?

Best regards,

I had no problems with setting up the IntelliJ application, however Aspose Maven repo seems to contain invalid jar.


Problem still exists in the 14.8.0.
Hi Tomasz,

Thanks for your inquiry. Unfortunately, it is difficult to say what the problem is without the document and code. We need these documents and code to reproduce the exceptions on our end.
Please note that, it is safe to attach files in the forum. If you attach your documents here, only you and Aspose staff members can download them. Also you can send the files to my e-mail as described here:
http://www.aspose.com/corporate/purchase/faqs/send-license-to-aspose-staff.aspx
You can also remove any sensitive information by replacing it with dummy data instead.
Best regards,

I understand, however the client strictly prohibited sharing the files.

For now I’m investigating other documents hoping that I get the same issue with files I can share.

Hi Tomasz,


Thanks for your inquiry. We will wait for your input and will be glad to look into this further for you.

Best regards,