Issue in PDF creation due to some images

Hi,


There is some issue in creating PDF file with some of the images used which crashes the server on which the PDF files is created and the PDF creation fails.

First, the document with images is inserted in a DOCX document and then a PDF files is also created (saved). The following code is used to create the PDF file.

com.aspose.words.Document outputDoc = new Document(“Output.docx”);

com.aspose.words.DocumentBuilder tempDocBuilder = new com.aspose.words.DocumentBuilder(outputDoc);

com.aspose.words.DocumentBuilder.insertDocument(Sample.doc, ImportFormatMode.KEEP_SOURCE_FORMATTING);

Document.save(“Output.docx”);
Document.save(“Output.pdf”);


The DOCX file is created successfully but the PDF file is not created and the server crashes.

I have attached the Sample.doc file with the images. Also, I have attached the simple java application PDFFileCreationIssue.java to test the issue on your side.

Can you please test the issue and check what is causing the failure of creation of PDF file.

Regards,
Prabhaker Kr.
Hello,

Additionnal information : server crashed due to too memory consumption,

Hi Prabhaker,


Thanks for your inquiry. We have tested the scenario at Windows 7, Jdk 1.8 using latest version of Aspose.Words for Java 16.8.0 and have not found the shared issue. Please use Aspose.Words for Java 16.8.0.

Sometimes Aspose.Words for Java throws OutOfMemoryError on Java. This is because the default Java heap space might not be enough for high memory spikes when processing some documents. In this case, the easy way to workaround is to increase the heap space for the JVM.