Hello,
One of our customer is facing serious issues when converting a Word document to images. The thread that performs this hangs deep inside Aspose code. This blocks all further image converting processing. The document concerned contains a set of footnotes.
We are using Aspose.Words java version 17.12 but also experienced the same issue with version 18.12. We cannot test with later version because license does not permit.
Stacktrace of the hanging thread:
Name: Attachment preview updater for dm: processing 0155C00133030182, update queue size: 1 (80), Alive: true interrupt
com.aspose.words.zzZ6X.zzD3(Unknown Source)
com.aspose.words.zzZ6X.zzD3(Unknown Source)
com.aspose.words.zzZZU.zzZ(Unknown Source)
com.aspose.words.zzYYE.zzZh4(Unknown Source)
com.aspose.words.zzYYE.zzZ(Unknown Source)
com.aspose.words.zzZEY.zzU(Unknown Source)
com.aspose.words.zzZEY.zzZ(Unknown Source)
com.aspose.words.zzXN.zzY(Unknown Source)
com.aspose.words.zzZ7H.zzZse(Unknown Source)
com.aspose.words.zzZ7H.zzS(Unknown Source)
com.aspose.words.zzZ6V.zzJ(Unknown Source)
com.aspose.words.zzYWE.zzn(Unknown Source)
com.aspose.words.zz93.zzJ(Unknown Source)
com.aspose.words.zz94.zz41(Unknown Source)
com.aspose.words.zzZMO.zz41(Unknown Source)
com.aspose.words.zz1F.zzZV8(Unknown Source)
com.aspose.words.zz1F.zzZ(Unknown Source)
com.aspose.words.zz1F.zzZw(Unknown Source)
com.aspose.words.Document.zzZ(Unknown Source)
com.aspose.words.Document.zzZ(Unknown Source)
com.aspose.words.Document.zzZ(Unknown Source)
com.aspose.words.Document.save(Unknown Source)
com.qonline.plugins.convert.handlers.ConvertHandlerImage.convert(ConvertHandlerImage.java:162)
Code that performs the save operation (is called for all pages in the document):
public ByteArrayOutputStream convert(Document doc, int page) throws Exception {
if (doc == null) {
throw new IllegalArgumentException(EXCEPTION_DOCUMENT_NULL);
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
if((page < doc.getPageCount()) && page >= 0) {
ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFormat.JPEG);
saveOptions.setPaperColor(Color.WHITE);
saveOptions.setPageCount(1);
saveOptions.setPageIndex(page);
saveOptions.setJpegQuality(this.quality);
saveOptions.setResolution(this.dpi);
saveOptions.setUseAntiAliasing(this.anti);
saveOptions.setUseHighQualityRendering(this.hires);
doc.save(out, saveOptions);
} else {
throw new IllegalArgumentException(EXCEPTION_PAGE_INDEX);
}
} finally {
out.close();
}
return out;
}
I have uploaded the document that isolates the problem. Note that when reducing to a single footnote, the image conversion works fine.
Footnotes simplified more.zip (21.2 KB)
Many thanks for helping out, regards,
Herm Flink