PDF Email Problems Thread

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.

Dear,

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,
Sezgin

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!

Regards,
Sezgin

Hi,

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.

Best

Hello,

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,

RECiPHER GROUP Melbourne

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.

Regards,

RECiPHER GROUP - Melbourne

Hi,

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

2 Likes

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.

Hello.

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.

Thanks

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,

Hi All,
I have DNS based multi-tenant setup which is also experiencing issue with PDF view / email attachment images missing and layout not correct, however on one site it works correctly?

Below are site config files - note the working site does not contain the “host_name” : “” and is not the site in the currentsite.txt file.

  • The “host_name” configuration has been tested in a combination of the accessible URL / localhost / local IP / public IP and also with http / https - no success in any. Bench restarts also performed after each.
  • Newly created site’s have the issue.
  • Nothing in browser dev console indicating issue.
  • File permissions on image files are the same across all sites - Owner/Group ‘frappe’ with 644.
  • Frappe 7.0.30 and ERPNext 7.0.34
  • Standard or custom print format has issue

Are there others experiencing this using DNS based multi-tenant setup? Any assistance would be greatly appreciated.

Working Site
{ "db_name": "-----", "db_password": "-----", "developer_mode": 1, "limits": { "space_usage": { "backup_size": 26.0, "database_size": 107.95, "files_size": 11.0, "total": 144.95 } }, "ssl_certificate": "/etc/letsencrypt/live/-----/fullchain.pem", "ssl_certificate_key": "/etc/letsencrypt/live/-----/privkey.pem" }

Site Not Working
{ "db_name": "------", "db_password": "------", "developer_mode": 1, "encryption_key": "-------", "limits": { "space_usage": { "backup_size": 6.0, "database_size": 10.02, "files_size": 3.0, "total": 19.02 } }, "ssl_certificate": "/etc/letsencrypt/live/-------/fullchain.pem", "ssl_certificate_key": "/etc/letsencrypt/live/-------/privkey.pem" }

Another Site Not Working
{ "db_name": "-----", "db_password": "-----", "ssl_certificate": "/etc/letsencrypt/live/-----/fullchain.pem", "ssl_certificate_key": "/etc/letsencrypt/live/-----/privkey.pem" }