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!