ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

PDF Email Problems Thread


Got a weird issue that i hope someone could help me and others solve it.


System Generated Preview for Printing Screenshot

PDF Generated Screenshot

PDF received via Email Screenshot (always with an extra blank page)

Note the difference. No pictures and letterhead. Plus layout has changed.

Thanks for taking the time! :slight_smile:

Layout issues when pdf print sent by email
PDF is not aligned
PDF formatting issue in E-Mails
Still haveing issuses with pdf attached to email
PDF alignment problem
PDF format error
[BUG] Invoice printing Problem


Not able to replicate the issue at my end.

Which version of ERPNext you are using? Also is it a standard print format or custom print format?

Also, check by adding host_name in site_config.json

vim frappe-bench/sites/site_name/site_config.json


 "db_name": db_name, 
 "db_password": db_password,
 "host_name": "http://yourerpnextsite"

PDF formatting issue in E-Mails
[solved] Wkhtmltopdf HostNotFoundError sending mail after v10 upgrade


I have the same issue:
Currently we are using erpnext with our local server.
We tried sending quotations directly from ErpNext, but we have some
issues on what is showing when our customer received the quotations.



  • letterhead is not showing in the email/pdf version

This is based on the Standard Print Format…

Kindly check this issue and inform us of the solution.



Your solution for adding the line “host_name”: “http://yourerpnextsite” site_config.json worked! I was lacking the underscore in hostname. Working now. :slight_smile:

Would just like to verify that is it normal to have the letterhead repeat in every page?



I think you can modify than in Configuration>Print Settings> Repeat Header and Footer in pdf

Kind regards,



Hi there,

Same problem here, but the “host_name” does not work for me. I have tried to write my site name in different ways:

“host_name”: “http://site1.local
“host_name”: “http://site1
“host_name”: “localhost”

None of above works for me. I have the problem generating pdf and sending email with Leads and Order Sales. I installed two months ago, so it’s a recent version of ERPNext.

I have restarted the server several times after every option.



We have same issue , our server located in local lan , and when we send pdf email to customer they don’t have access to my server , so when i change host name problem not solved .


Our erpnext installed in a local LAN and not on internet, even host name was was also changed, it is the same issue we are facing…


Use the static ip address of your local server.


“host_name”: “

then do a bench restart


Hi airzoink,

It worked fine!

Thanks! :slight_smile:


Hi ai_me, this worked in my local installation:


Hi neginy, this worked fine in my local installation.

No more problems with the letterhead / format. I can now see images properly. I still have this message you’re refering to, I’m looking for a way to delete the link to the “message”.


I add host name but still not work and same issue , : check bellow my config file :

“db_password”: “SDsdfgg43348h”,
“db_name”: “Sgji892Lj”,
“hostname”: “”,
“nginx_port”: 7005

i try bellow also but not work :

“db_password”: “SDsdfgg43348h”,
“db_name”: “Sgji892Lj”,
“hostname”: “”,
“nginx_port”: 7005

some one know what’s issue ?


Hi rtimagine,

I got mine working with:

“host_name”: “http://myip”,

Hope this helps!

Kind regards,


Invoice format different from email to print

I find problem i use “hostname”: “”, i change to “host_name”: “”, and problem solve .
now looking how i can remove "View this in your browser" and “Leave this conversation:” ??
Because it’s linked to local ip and server and when we send email to customer it’s not work for them .

Steps to install wkhtmltopdf with patched Qt (version 0.12.3) (for pdf generation)

I have managed to migrate my site to a new server to try and resolve some ongoing problems i have with pdfs attached to emails however it is still not solved.

The problem now being, PDF does not show header or product images, formatting is wrong, all the text is justified left and there is an extra page. There are some posts by me and others about this or similar problems which do not seem to help me and some seem abondoned/outdated or not solved.

In order to keep this post short and sweet i am not going to list all the posts that i have researched regarding this issue, instead i would just like to mention that i have a freshly migrated system and have run the below commands;

bench --site site1.local set-config hostname “
and checked that “hostname”: “” was in my site1.local/site_config.json

I have also run bench use

neither of which seem to fix my issue also the link in my email is wrong and still points to site1.local instead of

NOTE: print format appears correctly and when i press the PDF button the PDF gets generated correctly, only the pdfs attached to emails are broken right now

Thanks in advance


I know i am replying to myself here, but i noticed all images in the pdf attached to the email are little squares … so probably a link issues same as the incorrect link at the bottom of the email

I obviously need this to work … as i am not sure where to begin where do i find the errors relating to this? where do i find the logs? anything need some hints … please !


seems that it has to be host_name, not hostname.


That actually seems to have made things worse or maybe just different now i get no images even when try to generate a pdf when i use the pdf button. Which works fine with hostname

Also now that i am using host_name email pdf attachment still has no images, and the link is still wrong not site1.local anymore but kind of a weird mix of my email server and erpnext server twice like this

https://my,email.server/server/ Invoice/SINV-00018?format=Standard&key=09ed48dc02f19e22c0b2868d4284ee5e81370dde93bbd392bcf62bf7


I don’t suppose putting a slash at the end of the host name url fixes anything?

I’m still having issues letterheads missing with emailed pdf’s, although pagination, layout, and generation through browser work perfectly fine.