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

PDF Email Problems Thread


#1

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

Example:

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
#2

@airzoink,

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
#3

Hi,

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.

BELOW IS THE PRINT PREVIEW OF THE QUOTATION IN THE SYSTEM

BELOW IS THE PREVIEW OF PDF FILE WHICH HAS BEEN SENT TO CUSTOMER VIA EMAIL

  • 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.

Thanks…


#4

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?


#7

Hi,

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

Kind regards,

Alb


#9

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.

Regards


#10

Hello
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 .


#11

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…


#12

Use the static ip address of your local server.

Example:

“host_name”: “http://192.168.1.241

then do a bench restart


#13

Hi airzoink,

It worked fine!

Thanks! :slight_smile:


#14

Hi ai_me, this worked in my local installation:


#15

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”.


#16

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

{
“db_password”: “SDsdfgg43348h”,
“db_name”: “Sgji892Lj”,
“hostname”: “http://192.168.42.51”,
“nginx_port”: 7005
}

i try bellow also but not work :

{
“db_password”: “SDsdfgg43348h”,
“db_name”: “Sgji892Lj”,
“hostname”: “http://192.168.42.51:7005”,
“nginx_port”: 7005
}

some one know what’s issue ?
Regards


#17

Hi rtimagine,

I got mine working with:

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

Hope this helps!

Kind regards,

Alb


Invoice format different from email to print
#18

Hello
I find problem i use “hostname”: “http://192.168.42.51:7005”, i change to “host_name”: “http://192.168.42.51:7005”, 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 .
Regards


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

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 “bil-1.mydomain.com
and checked that “hostname”: “bil-1.mydomain.com” was in my site1.local/site_config.json

I have also run bench use bil-1.mydomain.com

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

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


#21

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 !


#22

seems that it has to be host_name, not hostname.


#23

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/bil-1.mydomain.com/bil-1.mydomain.com/Sales Invoice/SINV-00018?format=Standard&key=09ed48dc02f19e22c0b2868d4284ee5e81370dde93bbd392bcf62bf7


#24

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.