PDF Email Problems Thread

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.

Nope no change with a “/” added to the end of host_name also i have alignment and an extra page as well as no letterhead

Before changing to host_name it was the same as you describe above
" pagination, layout, and generation through browser work perfectly fine. "

@c0mputerking @superlack I have combined these threads and pinned them to the ERPNext section until June 30th. Hopefully consolidating these will make finding the information easier.

I also deleted a few posts which didn’t contribute to the conversation.

@s.ilter In the future, try to edit your posts to fix the images, instead of replying.


I installed latest version VM. Now when I try to send an order by email the pdf print don’t have any logo and layout of the document is totally messed-up.
If I just printout this same document there is no issue with it.
You can find both files attached.
Please help me to solve this issue.

Thanks in advance and regards,

Incorrectly Formatted Emailed PDF:

Correctly Formatted PDF:

Dear all,

I managed to solve this issue, please find below how I did, please make note my install is VM version 221215:

  1. in your shell type cd frappe-bench/sites/erpnext.vm
  2. nano site_config.son
  3. add by typing “host_name”: “http://localhost:xxxx” between {…} which I had only db_password" and “db_name” and no “host_name”
  4. save it and woila!



i have two issue.

  1. Getting pdf format is not aligned.all content move to left.
  2. When i’m tried to send mail with pdf attachment it takes too much time to process.



May I know ERPNext version you are working on? If not latest, please upgrade and then check again.

Sceenshot indicating alignment issue in the PDF format will be helpful.

Thanks Umair,

I’m using V4. how do i upgrade to latest version.

PDF generation takes a lot of processing power. What are your machine specs?

I have the same issue, have a prudction inviroment in version 6 in Ubuntu Server 14.04.2 and all work fine, wen i create a invoice the format of print preview see fine and when i generate the pdf file looks great, but when i use the send email feature thrall the tex is aligned on the left en the PDF file that i receive.

We are having the same issues since Updating to v6!

Specifically, when we View the PREVIEW of a DOC (Sales Invoice for example), the preview appears perfect on-screen!

We can also press the PDF button and the Document Formatting is correct.

The issue appears to be related to EMAILING. When we press the EMAIL button, the attached PDF destroys the correct formatting of the PDF…

The ‘Word Around’ at the moment is to:

Press PDF
Manually save the PDF file locally
Open Outlook
Create a New Email
Attached the PDF
Send Email …

Whereas, we have become used to simply PREVIEWING the DOC onscreen to determine if it appears OK…IF it does (which it nearly always used to), we simply select, EMAIL and send it directly from there…

Specifically, the Customer Name, Address, Phones etc. are all listed on the TOP LEFT of the PDF…

PLEASE PLEASE PLEASE look into this as we need to perform 5 steps to fulfill what was a single click!

Kind regards,


Hi Frappe Team,

Any news on the incorrect formatting of Emailed PDF’s since the upgrade to v6?

Unfortunately since the upgrade to v6, when we modify or create a Sales Invoice (and nearly all Documents from what we can tell) the appears correctly On Screen preview. The Document appears correct with our Logo and correct formatting, spacing, alignment etc.

Now however, whilst the preview still looks correct On Screen, when selecting Email, the attached PDF is dropping our Logo, Formatting, Spacing and Alignment.

As a result, we are having problems sending documents Directly from ERPNext. We now have to save the PDF file manually and then email it. Ironically, generating the PDF and saving it locally saves the correctly formatted PDF…

We really need to resolve this matter…please let us know how many others are experiencing this.


RECiPHER GROUP - Melbourne


I got it solved after adding my site to site_config.json please follow the instructions in the below link and make sure to add a comma. This Link

1 Like

Just wanted to add; we too were able to resolve the issue of PDF alignment not being correct when Emailing.

The solution (as stated above) is to add a single line to site_config.json for the SPECIFIC site you need to amend.

Add the line:

“host_name”: “http://yourerpnextsite


Maybe i have a different issue, but as i have already stated in this thread when I add “hostname”: “http://yourerpnextsite” to the site_config.json both my print view and pdf work correctly only pdf attached to my email is effected and shows no images and messed up formating.

However when i change it to “host_name”: “http://yourerpnextsite” print view is ok and shows letterhead but pdf and email attached pdf are not working.


I’m having the same issues, haven’t been able to fix them.

Here is the actual PDF (what we would like to see):

Here is what we get, whenever I click the Print or PDF button, we get the wrong formatted version of the report.

I’ve tried the solutions that are mentioned in this post, from changing my host_name with an IP and changing host_name to hostname on my site_config.json

Here’s my site_config.json:

Any input from the frappe team would be appreciated. We are on version (ERPNext) v6.27.25 and (Frappe) v6.27.24.


1 Like

Same issue here,

tried with some of the propossed solutions but did not work

Any suggestion

Thank you

this is weird, i followed all the available solutions, but i can’t seem to solve it.

I’m using Google cloud service. So the IP address that I put in should be the ip address of eth0 right?

I’ve tried inputting the public IP address of the server to no avail.

1 Like

Just put http://localhost,