Issue with PDFs, which contain product images


we faced an pdf issue in

ERPNext: v7.0.45
Frappe Framework: v7.0.33

When a product has an image, which will be shown in the PDF, no pdf is generated. Theres no error reporting. It loads forever and crashes the whole system! It does not matter if I close the not loading PDF window. The system is gone from the moment I click the PDF button.

I need to reboot the whole system for making ERPNext work again. Maybe restarting bench would be enough too.

How can we fix this?

Thank you very much.


This is working fine in my test account. Can you please check for the error message in the browser’s console?

@umair There are no error messages in the console. The new tab opens and just loads forever, while the rest of the system is gone.

please check

Hello umair, thank you. But we have the issue as described.

Hi ci2016,

I am encountering the same issue. The image displays correctly in the HTML format but when trying a PDF it loads forever and crashes MariaDB.
I tried to allocate more memory but it still doesn’t work.

Did you find a solution ?


Hi chdecultot, unfortunately I didn’t find a solution. My customers had issues with this again a few days ago.

My workaround was to customize the PDF and simply hide the image from the PDF, since I don’t think that images of the products are necessary on invoices or similar. Of course, this is not the solution.

Do you use Ubuntu as well?

Thanks for the answer,

Yes I am using Ubuntu too.

After reading other threads on the forum I think the problem is linked with the image permission.
Only “public” images can be printed in PDF.

I am currently testing on a few items and it seems to work so far.
Initially all images on my ERPNext instance had been uploaded in private mode.

You also need to define a “host_name”: “YOUR_SITE” in site_config.json

I hope it will work for you as well :slight_smile:

The host_names are already defined.

You are saying, that it seems to work so far. Is it a solution or a workaround?

I don’t think it is a solution to leave this issue open. There should be a solution, a error message or similar. Everything is better, that letting the system crash. Is there a Issue on Github?

I totally agree with you, there should be an error message instead of having MariaDB crash.

But it also make sense that all images meant to be printed should be public (since there are supposed to be shared accross the organization).

I will continue to investigate and make sure it works 100% of the time with public images and it is not related to something else. And if needed then I guess we should propose a correction to have an error message displayed when hitting the “PDF” button.