V11 pdf file don't apply css and image

The pdf preview works well.
But when I export the pdf file, the css and images displayed wrong.
he official v11 beta also have this issue.

https://github.com/frappe/erpnext/issues/15598

2 Likes

@gmplab
May be It’s not loading boostrap css and JQuery in website context.

Because Print Format used Bootstrap Row&Column html style to generate the pdf template.

Same problem here!

Can someone test this PR, and see if it fixes the problem? fix: identify production mode for PDF generation by codingCoffee · Pull Request #6559 · frappe/frappe · GitHub

Hello!

I´m still having this issue, i´m using v11 in production mode along with lets encrypt
How do i solve this problem?

Bench Manager: v0.0.1 (develop)

ERPNext: v11.1.11 (master)

Frappe Framework: v11.1.11 (master)

I edited my json and put the domain

“host_name”: “https://mydomain.com”,
“http_port”: 443,

and still wasn´t able to get this working,

Have you tried setting the hostname to the ip of the ERPNext host?
“host_name”: “192.168.1.xxx”,

Yes! still having problems
i used localhost, my domain, internal ip and updated wkhtmltopdf and it didn´t work but

I’m too getting same problem, css not loading for the pdf reports , because of this alignment not perfect, font is looking like dottedmatix print, wkhtmltopdf 0.12.5(with patched qt) updated everything, still not able find proper solution, please help me out from this problem.

Well this issue is in v10 too.

I have custom print format with heavy css design pdf never worked properly and we have to use print button and then save as pdf.

This is from wkhtmltopdf. Can we not upgrade to xhtml2pdf instead, as xhtml2pdf claims to have support for modern css.

If anyone can confirm that will help then we can look into this and try to push a pr.

Edit : weazyprint is another option but on python 3.4

I´m not using custom print format or anything and i´m having this problem, i did a fresh install with production and develop branch both showing the same thing, anyone have any clues of how to solve this?

Can you share screenshot of the json file?

Looks like the host have name issue to me.

{
“db_name”: “XXXXXXXXXXXXXX”,
“db_password”: “XXXXXXXXXXXXXXX”,
“encryption_key”: “XXXXXXXXXXXXXX”,
“limits”: {
“space_usage”: {
“backup_size”: 480.0,
“database_size”: 419.42,
“files_size”: 332.0,
“total”: 1231.42,
“host_name”: “erp.atriobusiness.com.br”,
“http_port”: 443
}
},
“ssl_certificate”: “/etc/letsencrypt/live/erp.atriobusiness.com.br/fullchain.pem”,
“ssl_certificate_key”: “/etc/letsencrypt/live/erp.atriobusiness.com.br/privkey.pem”
}

What is the name of the site folder?

erp.atriobusiness.com.br

Try this? “host_name”: “http://erp.atriobusiness.com.br”,

I´ve tried, same result: tests that i did:
“host_name”: “erp.atriobusiness.com.br”,
“host_name”: “https://erp.atriobusiness.com.br”,
“host_name”: “http://erp.atriobusiness.com.br”,
“host_name”: “https://localhost”,
“host_name”: “http://localhost”,
“host_name”: “127.0.0.1”,
“host_name”: “10.20.30.5”,
“host_name”: “https://10.20.30.5”,

Did you do bench restart and nginx reload after trying each host name?

no! i´ll try that now

Now i did and no success