Please take a look at following code snippet:
ByteArrayInputStream bis = new ByteArrayInputStream(documentBytes);
Document doc = new Document(bis);
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.JPEG);
ByteArrayOutputStream imageStream = new ByteArrayOutputStream();
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
saveProblem.zip (19.5 KB)