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

Free Support Forum - aspose.com

DOCX to PDF conversion leads to ClassCastException

Hello

I use Aspose.Words for Java 21.10 to convert docx to pdf this way:

Document document = new Document("test.docx);
document.save("Test.pdf");

Using the attached Document input.docx (32.1 KB)
, the following exception is thrown:

java.lang.ClassCastException: com.aspose.words.internal.zzWhE incompatible with com.aspose.words.internal.zzWuL
    	at com.aspose.words.zzD0.zzWJq(Unknown Source)
    	at com.aspose.words.zzD0.zzW6y(Unknown Source)
    	at com.aspose.words.zzD0.zzWPL(Unknown Source)
    	at com.aspose.words.zzZ3b.zzWPL(Unknown Source)
    	at com.aspose.words.zzTf.zzWPL(Unknown Source)
    	at com.aspose.words.zzWuZ.zzZa5(Unknown Source)
    	at com.aspose.words.zzWuZ.zzWPL(Unknown Source)
    	at com.aspose.words.zzsv.zzWPL(Unknown Source)
    	at com.aspose.words.zzXfx.zzWPL(Unknown Source)
    	at com.aspose.words.zzXS6.zzWPL(Unknown Source)
    	at com.aspose.words.zzZqR.zzWPL(Unknown Source)
    	at com.aspose.words.zzXyf.zzWPL(Unknown Source)
    	at com.aspose.words.zzXfx.zzWPL(Unknown Source)
    	at com.aspose.words.zzWID.zzWPL(Unknown Source)
    	at com.aspose.words.zzZpj.zzWPL(Unknown Source)
    	at com.aspose.words.zzVWg.zzWPL(Unknown Source)
    	at com.aspose.words.zzZ3b.zzZa5(Unknown Source)
    	at com.aspose.words.zzZ3b.zzWPL(Unknown Source)
    	at com.aspose.words.Document.zzWPL(Unknown Source)
    	at com.aspose.words.zzYoO.zzD8(Unknown Source)
    	at com.aspose.words.zzYoO.zzWPL(Unknown Source)
    	at com.aspose.words.zzyR.zzWPL(Unknown Source)
    	at com.aspose.words.Document.zzD8(Unknown Source)
    	at com.aspose.words.Document.zzWPL(Unknown Source)
    	at com.aspose.words.Document.save(Unknown Source)

I also testet with older versions of Aspose.Words, and it worked up to 21.6, but since 21.7 the exception occours.

Please have a look at this problem.

Kind regards!

@dvtdaten

We have logged this problem in our issue tracking system as WORDSJAVA-2663. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

I have some additional information for you: Removing the line feed (compare input.docx with input2.docx (32.2 KB)
) in the table is enough to avoid the exception and make the conversion work.

@dvtdaten Thank you for additional information. I added this information to the appropriate defect. We will let you know once the problem is resolved.