Aspose PDF save method stuck permanently

Hi,
I am struggling with the ASPOSE pdf, document.save method, here its getting saved to a stream.
For the below code whenever the html fragment gets added in document object the doc.save method gets stuck forever.
Here processedHtml is a string html.
Document doc = new Document();
HtmlFragment htmlFragment = new HtmlFragment(processedHtml);
HtmlLoadOptions options = new HtmlLoadOptions();
// Set Print or Screen mode
options.setHtmlMediaType(HtmlMediaType.Screen);
htmlFragment.setHtmlLoadOptions(options);
doc.getPages().add().getParagraphs().add(htmlFragment);
doc.getPages().get_Item(1).getPageInfo().setHeight(11000);
// Save the document to a memory stream
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
doc.save(outputStream);
The control never gets beyond doc.save method, the program is stuck at doc.save method.
// Get the byte array from the output stream
byte[] pdfBytes = outputStream.toByteArray();

I am using java 17, -Xms3000m -Xmx3500m, it’s part of spring boot. The aspose version for pdf that I have tried : 23.12, 23.7, 21.1, for all of these versions the control is getting stuck when doc object is copying the data to memory stream. I have tried increasing the memory, codec buffer nothing helped.

My most of the productivity time gets into fixing such ASPOSE ISSUES.

PLEASE SUGGEST THE FIX ASAP.

@arindam.mishra

We tested the code snippet with both JDK 17 and JDK 1.8 but could not reproduce the issue that you mentioned. We used 24.1 version of the API. Can you please try using it and if issue persists, please share a sample console application for our reference in .zip format so that we can again test and address it accordingly.

I can see the very latest version is 23.12, at Aspose.PDF | Java PDF Document Processing Class Library. I am using aspose-pdf api.

@arindam.mishra

Please check and download the latest version from this link. You can also update your pom.xml accordingly.