PDF does not respect formatting

Hello, when I see the PDF of a quotation, it looks different from the preview. For example, this is a preview:

When I press PDF button, this PDF is shown:

How can this be solved or troubleshooted? logs does not show any error.

This was a erpnext site I had in other server. In the other server it worked well.

Versions are the same:

[bench@node4037 public]$ bench version
erpnext 12.14.0
frappe 12.12.0

[bench@node4037 public]$ bench --version

The only difference is wkhtmltopdf version.

[bench@node4037 public]$ wkhtmltopdf --version
wkhtmltopdf 0.12.4 (with patched qt)

The other server has version 0.12.3, so I don’t think this is the problem.


i had issue like this it was because am not using ssl and no domain

Hello… this is present in site_config.json file of the site:

"host_name": "https://erp.example.com"

Is that correct or should I specify it in some place else?

I have this same site_config.json in the old server. I am just migrating old server to a new server. In the old server, that definition is exactly the same, and PDF’s were generated correctly.

Is there a way to troubleshoot it? some file that shows what error has occured? it is likely that some file is missing (due to some part of the URL), but I cannot know what URL is trying to use.

I have also a custom print format that uses an IMG, however, the image is not shown in the PDF either.


It may help to change the hostname to the ip.

Hello, IP did not help, however, I have solved it by using this in host_name:

"host_name": "http://erp.example.com:8020"

This is because I have a reverse proxy in Apache. That is, the request comes to https://erp.example.com and Apache calls internally http://erp.example.com:8020 which is served by Nginx.

Regarding this, I have 2 questions of millions dollars:

  1. Why does it work in my old server when host name is https://erp.example.com, since the configuration of Apache and reverse proxy is the same?

  2. By using http://erp.example.com:8020 as the host name, will I have problems with links that are generated in e-mails?

Maybe some configuration of wkhtmltopdf is missing in order for it to respect the reverse proxy (I don’t really know why is this problem)