Pdf's not looking nice as html documents (assume CSS missing)

Continuing the discussion from V11 pdf file don't apply css and image:

I am having trouble with the pdf’s created on my v11.1.16 instance (wkhtmltopdf 0.12.4 (with patched qt)) I know this is not the most recent version of wkhtmltopdf but should work still though

From other Topics in this regards I figure it’s the CSS which is not being processed between html and the pdf created

Full Page view

pdf view

tried, did not change anything. Is there any other advice out there?

1 Like

I’m having the exact same issue- fonts load fine, but the CSS (grid/alignment) formatting is stripped out and the print is resized to ~65% of what it should be.

Per

and

(plus a few others)

I…

  • did the libssl1 install, then updated wkhtmltopdf to the latest version 0.12.5
  • added “http_port”: 443 to my site_config
  • reset server hostname via hostnamectl {sitename}
  • tried with all firewalls down
  • ran ‘bench use’ and ‘bench setup nginx’ as well as ‘use-url https’, etc
  • half a dozen other things mentioned in various other fixes; then reset, and cleanly did just the basics listed above again.

I got nothing. Still doing this with custom print formats as well as core- both saving to pdf as well as trying to actually print.

The ability to print invoices is kind of super business-critical if anyone has any suggestions, they are greatly longed for.

1 Like

Try this:

Just change “http://localhost:8000” to the URL of your server.

BKM

that solved it for me, hurrah!

cd /home/frappe/frappe/bench
bench --site erp.mydomain.com set-config hostname "https://erp.mydomain.com:443"

thx @bkm for pointing me towards the right direction

@chancegold please kindly let us know whether this fix solves it on your end as well. Then we can close this Topic

5 Likes

There’s also a potential problem where nginx doesn’t listen on IPv6, but local tools do use IPv6.
In order to check that:

curl -4 http://erp.mydomain.com
curl -6 http://erp.mydomain.com

If the results aren’t identical, it’s very likely that your nginx doesn’t listen on IPv6.
Just add listen [::]:80; or listen [::]:443 ssl; to your nginx site config file in order to resolve the issue.
See my PR at feat(config): Add IPv6 listener to nginx site configuration by deajan · Pull Request #1312 · frappe/bench · GitHub

1 Like