ERPNext Conference 2019* ERPNext.com Blog

Email pdf is not formatted properly


#1

when we are sending email to the vendor/employee from our erp suppose quotation / salary slip the attached pdf is un formatted. but when am trying to print or save pdf from erp its showing all right.

help me to slove this issue


Facing with print preview and pdf export not match
Print Format displays JavaScript result, howevever exporting to PDF or printing ignores it
#2

i also experienced this issue…

mine is formatted properly in 1 page, but when we send it to customer through email, the PDF file became 3 page and nor formatted properly…

anyone experienced this and know the solution so we can send PDF throught email without save it first to our PC…


#3

Try adding this to site_config json - change the localhost to whatever your site is actually called
“host_name” : “http://localhost”,

You might need to do a bench restart to let the change take effect


#4

i will try this…

thanks for the suggestion, but any explanation about correlation between this action with the PDF file ?


#5

I don’t know exactly why, but there are several posts indicating that adding the host into the .json file fix the problem with PDF


#6

You might call it a design constraint? The wkhtmltopdf process, that generates the pdf from the html page, runs on the server not the client browser.


#7

That is correct, and it cannot tell what server it is to be the source of the special formatting unless it is specifically called out in the site_config.json for the wkhtmltopdf process to use as a referrence.

BKM


#8

This solution addresses the link problem in emails. It does not address formatting issues. Am I right?

I agree that wkhtmltopdf needs to be revised to address this.