Skip to content

Getting PDFs to work on different versions of Ubuntu

Dave Wong edited this page Jul 27, 2020 · 5 revisions

Always check errors logs to make sure you're fixing the thing you think you're fixing.

apt list | grep <package> is useful to find if a package is already installed

Below are the steps that have been successful in getting PDFs to work on different versions of Ubuntu. It's usually not a good idea to start installing random packages so you should dig a bit yourself to make sure that the solutions below will fix your specific issue (that you already looked for because you check the logs right)

Ubuntu 16.04 Xenial

apt-get install --no-upgrade libxrender1

apt-get install --no-upgrade libssl1.0-dev

Ubuntu 18.04 Bionic

sudo apt-get install libjpeg62

Ubuntu 20.04 focal

  • You have to point the bin in the projects environment to WKHTML_PDF_BINARY=wkhtmltopdf

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.focal_amd64.deb

sudo dpkg -i wkhtmltox_0.12.5-1.focal_amd64.deb

You'll get an error about dependencies so to resolve those run:

sudo apt-get install -f

Once the dependencies are installed run the install command again

sudo dpkg -i wkhtmltox_0.12.5-1.focal_amd64.deb