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

Free Support Forum - aspose.com

Crash when converting specific document to PDF

When converting the attached document to PDF, Aspose crashes with the following error:

jpype._jexception.java.lang.IndexOutOfBoundsExceptionPyRaisable: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

Here is the code:

def convert_to_pdf(src_path, dest_path):
    Document = jpype.JClass('com.aspose.words.Document')
    SaveFormat = jpype.JClass('com.aspose.words.SaveFormat')
    Color = jpype.JClass('java.awt.Color')

    doc = Document(src_path)
    # Fix Pink Background Issue
    white = Color(255, 255, 255)
    doc.save(dest_path, SaveFormat.PDF)

The last line triggers the exception.

Using aspose-words-19.1-jdk16.jar

bad docx.zip (18.4 KB)


We have tested the scenario using the latest version of Aspose.Words for Java 19.5 and have not found the shared issue. So, please use Aspose.Words for Java 19.5.

Thanks, that resolved our issue.