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.setPageColor(white)
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)