ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Email pdf is not formatted properly

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

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…

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

i will try this…

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

1 Like

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

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.

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

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.

1 Like

Hello @community,

I run into the same issue.

Regarding to docker environment frappe_docker:
What should be in my sites/[siteName]/site_config.json?

Best Greetings

Just for completion: This works:
In the /…/docker/volume/<…>_sites volume
the image name [project-name]-assets (form your docker-compose file)
For me it was: “host_name”: “http://[project-name]-assets”