Email attachement pdf is missing images

Dear colleagues,

I have the following strange issue: I have the Supplier Quotation Doctype with a custom print format, which contains embedded images (all of the public uploads). On print > PDF, the pdf is rendered without any issues including the pictures.

However, if I send the document using Menu > Email, select to attach the print format, send it, it is received as pdf without images. What could be wrong? site_config.json contains the correct hostname. The system is on ERPNext v12.1.1. The system can access the image resource.

Thanks for any hints!

In previous versions, myself and others experienced similar issues. It was commonly solved by ensuring the hostname was specified in site_config.json. It sounds like you already checked this though.

Only other thing I can think of would be to check that you are using wkhtmltopdf 0.12.5.
I was getting errors on my v12 instance with 0.12.3 and had to install version 0.12.5.

Best of luck,
Max

Hi @maxvogel,

thanks for your input. I will try wkhtmltopdf version 0.12.5, currently running 0.12.3. Also, I have noted that all out other system are running DNS multitenant configurations, but this does not, will also give this a try…

Hi all,

this was resolved now; there are two possible solutions:

  1. do not use relative URLs (i.e. we had <img src="{{ doc.image }}">, use instead <img src="https://www.yourerp.com{{ doc.image }}">
  2. enable DNS multitenant (in which case the hostname seems to be properly used also when sending the pdf in a mail)

Hopefully this helps someone else.