Skip to content

Instantly share code, notes, and snippets.

Last active March 7, 2020 12:34
What would you like to do?
Wkhtmltopdf - Arabic PDF differs between Mac and Linux
#When I deployed my Flask HTML/CSS to PDF application on Ubuntu server, Wkhtmltopdf rendered the same PDF with different #styles.
#The Ubuntu version rendered:
# 1- long Arabic text in one line without wrapping the text
# 2- the CSS alignment was not accurate
# 3- black header was auto generated
#The solution was to uninstall the current version of Wkhtmltopdf and install Wkhtmltopdf With Patched QT Setup.
#---------------------------- Steps:
#---------------------------- A- Unistall Wkhtmltopdf:
sudo apt-get remove wkhtmltopdf
#---------------------------- B- Install Wkhtmltopdf With Patched QT Setup:
# [I found the solution for installing Wkhtmltopdf in the following gist:
cd ~
sudo apt-get install libfontenc1 xfonts-75dpi xfonts-base xfonts-encodings xfonts-utils openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig -y
sudo wget
sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
sudo apt --fix-broken install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment