Docx -> pdf conversion error: java.lang.IllegalStateException: Infinite loop detected

Hello,

When trying to convert a .docx file to pdf, the following exception occurs:

$ jdk-9.0.4/bin/java -cp "lib/*;AsposeSample.jar" src.Main
Exception in thread "main" java.lang.IllegalStateException: Infinite loop detected.
        at com.aspose.words.zzYX6.zzzZ(Unknown Source)
        at com.aspose.words.zzYX6.zzn(Unknown Source)
        at com.aspose.words.zz99.zzJ(Unknown Source)
        at com.aspose.words.zz9A.zz5i(Unknown Source)
        at com.aspose.words.zzZN0.zzZ(Unknown Source)
        at com.aspose.words.Document.updatePageLayout(Unknown Source)
        at com.aspose.words.zz4L.perform(Unknown Source)
        at com.aspose.words.zz4M.zzM3(Unknown Source)
        at com.aspose.words.zz1M.zzYY(Unknown Source)
        at com.aspose.words.zz1M.zzZ(Unknown Source)
        at com.aspose.words.zz1M.zzZF(Unknown Source)
        at com.aspose.words.Document.zzZ(Unknown Source)
        at com.aspose.words.Document.zzZ(Unknown Source)
        at com.aspose.words.Document.save(Unknown Source)
        at com.aspose.words.Document.save(Unknown Source)
        at src.Main.main(Main.java:16)

My source code:

package src;

import com.aspose.words.Document;
import com.aspose.words.FontSettings;
import com.aspose.words.License;

public class Main {

    public static void main(String[] args) throws Exception {
        License l = new License();
        l.setLicense("Aspose.Total.Java.lic");
        FontSettings fontSettings = new FontSettings();
        fontSettings.setFontsFolder("arial", false);
        Document doc = new Document("file1.docx");
        doc.setFontSettings(fontSettings);
        doc.save("file1.docx.pdf");
    }
    
}

I use the lastest JAR file (aspose-words-18.3-jdk16.jar) and latest JDK (jdk-9.0.4) on Windows. The folder “arial” contains single file arial.ttf (I tried with different combinations of fonts, and the problem seems to be unaffected by them).

Unfortunately, the size of file1.docx is around 5 MB, so that I cannot attach it to the message. I can send it to you if needed. There are two more docx files that cause the same exception (they are also larger than 3 MB), but they haven’t been published yet.

Could you please help me with this issue?

Thanks!

@shutovich,

Please ZIP the file(s) you are getting this problem with, upload the ZIP file to Dropbox and share the download link here for testing.

Please download this file: Dropbox - 2332681_RevisedManuscript_JBP_02_01_16.docx.zip - Simplify your life

@shutovich,

Thanks for your inquiry. We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-16606. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

Hello,

Is there any progress regarding this issue? It’s been almost a year since I’ve reported it.

I’m testing with aspose-words-18.12-jdk16.jar now, and I have 5 more examples where this error occurs. Could you please tell me if you think I need to test with a more recent version?

Thanks!

@shutovich,

I am afraid, because of complexity, the implementation of this issue has been postponed till a later date (no estimates are available at the moment). We will inform you via this thread as soon as this issue is resolved. We apologize for your inconvenience.

Please ZIP and upload your input Word documents, Aspose.Words generated PDF files showing the undesired behavior and code snippet here for testing. We will then investigate the issue on our end and provide you more information.

The issues you have found earlier have been fixed in this Aspose.Words for .NET 20.12 update and this Aspose.Words for Java 20.12 update.