PDF problem after using Let's Encrypt to setup HTTPS

After installing Let’s Encrypt, Pdf is not working correctly. Everything is left aligned and images are not displaying. Same thing is also happening in the email attachment.

Added “host_name”: “https://erp.domain.com” in site_config.json, but no luck. Can anyone please help!

I don’t know if this answer helps,
when you use HTTPS make sure that all links to your website are HTTPS, so for example if your calling an image for your PDF in https://erp.domain.com and your image is http://erp.domain.com/somewhere/image.png or any other type of resources, that will mark the website as a HTTP, so make sure you use HTTPS everywhere
one of the ways to do that is to automatically redirect all HTTP requests to HTTPS

Other cause might be that your images are not public

Other cause might be that your actual host name does not match the host name you added in site_config.json
, check whats ur host name hostname --fqdn

1 Like

run the command in bench: bench set-url-root site_name https://newlink

the problem is the script convert html to pdf read the link of erp

I checked that image is public.

I already tried it, but no luck. :frowning_face:

Image is actually loading on HTTPS and it is public.

This might be the case. But as far as I found one server can have one hostname. I might be wrong, but here I found similar answer. However, I added hostname in /etc/hosts, but didn’t change anything.

Hi @mar, did you find a solution?ç

I have the same case.

Regards

Hi @mar and @federico_calvo,

have you checked if the ssl-module required for https-connections of wkhtmltopdf is available? There is an easy test for this: create a simple html file, which includes an image from an https source, e.g. something like

<html>
  <head>
    <title>Test</title>
  </head>
  <body>
    <h1>Hello World</h1>
    <img src="https://en.wikipedia.org/wiki/File:Erpnext_logo.svg" alt="Logo" />
  </body>
</html>

Save this as test.html on the server and then run

$ wkhtmltopdf test.html test.pdf

and observe the errors. If you find something like

QSslSocket: cannot call unresolved function SSLv23_client_method
QSslSocket: cannot call unresolved function SSL_library_init

install libssl1.0-dev:

$ sudo apt install libssl1.0-dev

Then, try again and see if is resolved…

Hope this helps.

5 Likes

Hi @mar

Pls find solution in the following thread:

Cheers!

Installation of libssl1.0-dev solved my issue:

$ sudo apt install libssl1.0-dev

2 Likes