We're sorry AsposeApp doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.app

PDF document not created when converting from HTML if it contains images


Recently, we started experiencing a strange problem.
We use Aspose java to convert html documents to PDF in a bigger web application that is deployed on the Tomcat web container.
Everything was working more or less fine until recently when conversion stopped working with any html documents if there is any image within. Our htmls are constructed dynamically, and image data is received dynamically as well. Images are referenced as base64 encrypted data within an html, e. g. <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABHgA …

If I copy the same html and convert it in a standalone application using the same version version of aspose and other parameters, it is successfully saved to PDF.

If I specify image src using a path <img src=“https://some_image.png” … within our web application, it works as well. But if the image src is in the format <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABHgA , the code stops when creating the output document:

Document document = new Document(targetStream, options);

No exception is thrown, the code never ends.
We tried to look into program internals and we see that the thread is stopped at Object.wait(). I attached the thread dump to the issue. Maybe you could provide some information about what’s going on and what we could also check, what could be causing such a behavior?

thread_waiting.png (100.7 KB)

The behavior is observed using Aspose 21.8 and 23.6. The attachedd thread dump is of version 23.6.
Java: 17

Thank you

Arjana Bivainiene

This topic has been moved to the related forum: https://forum.aspose.com/t/pdf-document-not-created-when-converting-from-html-if-it-contains-images/268739