[Solution] Images missing in PDF

Problem: ERPNext v14.10.0 (version-14) installed on Ubuntu server. When PDF files are generated the images in header are not shown.

Cause: Frappe framework uses a library called wkhtmltopdf to generate PDF files. If this library is not installed or if an incorrect version of this library is installed then the images in header may not be included in PDFs generated.

Solution: Install “wkhtmltopdf 0.12.6 (with patched qt)”

Steps to install “wkhtmltopdf”

Open terminal and run below commands

wkhtmltopdf --version

The above command will show the current version of wkhtmltopdf if it is already installed.

sudo apt-get remove wkhtmltopdf 

Run above command to uninstall the current version of wkhtmltopdf

sudo apt-get install -y xfonts-75dpi
sudo apt-get -y install libssl1.1
sudo wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb
sudo cp /usr/local/bin/wkhtmlto* /usr/bin/
sudo chmod a+x /usr/bin/wk*

Finally run below command to check if wkhtmltopdf is installed.

wkhtmltopdf --version 

You should see below response.

wkhtmltopdf 0.12.6 (with patched qt)

Now generate PDF and you should see images.

3 Likes

System is Giving error message at this level:

wkhtmltox : Depends: libssl1.1 but it is not installable

To Resolve this, use the following command.

echo "deb http://security.ubuntu.com/ubuntu focal-security main" | sudo tee /etc/apt/sources.list.d/focal-security.list

sudo apt-get update
sudo apt-get install libssl1.1

Rest solution is good…

1 Like

This command is failing with following messages:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libssl1.1
E: Couldn't find any package by glob 'libssl1.1'
E: Couldn't find any package by regex 'libssl1.1'

I am using Ubuntu 22.04 LTS.

Regards,

echo “deb Index of /ubuntu focal-security main” | sudo tee /etc/apt/sources.list.d/focal-security.list

sudo apt-get update
sudo apt-get install libssl1.1

use these commands

1 Like