Free Support Forum - aspose.com

Document.save method is hanging because of doc`s content

Hi,

Please take a look at following code snippet:
ByteArrayInputStream bis = new ByteArrayInputStream(documentBytes);
Document doc = new Document(bis);
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.JPEG);
options.setResolution(20f);
options.setJpegQuality(renderQuality);
options.setPageIndex(0);
options.setPageCount(1);
ByteArrayOutputStream imageStream = new ByteArrayOutputStream();
doc.save(imageStream, options);
bis.close();
imageStream.close();

We use it for first page preview picture creation. We were successfully using it but we encountered file which makes the save method hanging. It is quite short doc file, three pages but contains three charts. The charts look like created “manually” it means many objects, shapes, lines are grouped into chart.

I figured out that mentioned charts are the problem reason. When I delete them everything works fine. Furthermore when I only ungroup them using MS Word, the file is converted to jpeg correctly without hanging.
Unfortunately ungrouping is not the only activity which makes file convertable but its difficult to capture what exactly makes it.

Can you try to reproduce the problem using attached file? I removed all sensitive data so it looks like it is.

Thanks in advance
Best Regards

saveProblem.zip (19.5 KB)

@embos,

Thanks for your inquiry. After an initial test with the licensed latest version of Aspose.Words for Java i.e. 18.9 , we were unable to reproduce this issue on our end. We would suggest you please upgrade to the latest version of Aspose.Words for Java. Hope, this helps.