itsdave
February 26, 2019, 2:46pm
1
When i install frappe and erpnext with the easy install scipt, wkhtmltopdf is installed in Version 0.12.3 which causes problems if you use https.
Seems its due the usage of old SSL protocols like SSLv3 which aren`t supported anymore.
States that “wkhtmltopdf has been locked down to 0.12.3 intentionally since 0.12.4 has problems.”
But the manual Install guide says:
“wkhtmltopdf (version 0.12.5) (for pdf generation)”
Which would match with this recommendation:
opened 03:59PM - 14 Jun 16 UTC
closed 12:46PM - 01 May 18 UTC
Fixed
# Edit
#### Fixed in 0.12.5 - Please update to this version.
#### !! Note that… downgrading openssl is not a solution !!
# Original issue
Ubuntu Ubuntu 14.04.4 LTS
```
Loading pages (1/6)
QSslSocket: cannot resolve SSLv3_client_method ] 10%
QSslSocket: cannot resolve SSLv3_server_method
```
I have libssl-dev and openssl installed.
```
wkhtmltopdf --version
wkhtmltopdf 0.12.3 (with patched qt)
```
So i replaced the installed version with 0.12.5 from:
https://wkhtmltopdf.org/downloads.html
The PDF generation does not run into ssl errors anymore, but the font size is smaller then with 0.12.3, which could have something todo with https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3241
But since the manual install suggests 0.12.5 my question is: is there a way to get the corret font size?
trentmu
February 27, 2019, 8:24am
2
Try adding in xfonts-75dpi like this (also added in a couple of lines about the update…)
sudo apt install xfonts-75dpi -y
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.stretch_amd64.deb
dpkg --install wkhtmltox_0.12.5-1.stretch_amd64.deb
itsdave
February 27, 2019, 9:57am
3
Thanks for your reply.
I allready had xfonts-75dpi and wkhtmltox_0.12.5-1.stretch_amd64.deb installed. So this brought no changes for me.
As i have seen, since wkhtmltopdf 0.12.4 dpi was somehow hardcoded zo 96. So for me the solution was to set settings to: dpi 75 and zoom 1.28 (i.e. 96/75), which produces almost identical output.
As seen on https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3241
i did this by changing ./apps/frappe/frappe/utils/pdf.py from line 61 to the following:
def prepare_options(html, options):
if not options:
options = {}
options.update({
'print-media-type': None,
'background': None,
'images': None,
'quiet': None,
# 'no-outline': None,
'encoding': "UTF-8",
#'load-error-handling': 'ignore',
# defaults
'margin-right': '15mm',
'margin-left': '15mm',
#options for wkhtmltopdf 0.12.5
'zoom': 1.28,
'dpi': 75
})