pdfkit utilise wkhtmltopdf pour convertir du HTML en PDF.
Sous Linux :
sudo apt install wkhtmltopdf
Sous Windows :
wkhtmltox-0.12.6-1.msvc2015-win64.exe
C:\Program Files\wkhtmltopdf\bin
(venv) $ pip install pdfkit
Transformation d'un fichier test.html en test.pdf :
import pdfkit pdfkit.from_file('/home/marc/test.html', '/home/marc/test.pdf')
Même chose à partir d'une chaîne de caractères :
import pdfkit pdfkit.from_string('<h1>Hello World!</h1>', '/home/marc/test.pdf')