Has anyone been able to install wkhtmltopdf on python:3.6.0-alpine.
I have tried all the solutions present on the internet. I need to use pdfkit which internally uses wkhtmltopython to convert html to pdf.
Has anyone been able to install wkhtmltopdf on python:3.6.0-alpine.
I have tried all the solutions present on the internet. I need to use pdfkit which internally uses wkhtmltopython to convert html to pdf.
In case someone would like to have the full line that needs to be added to the Dockerfile:
RUN apk update && apk add wkhtmltopdf
or:
RUN apt-get update && apt-get install -y wkhtmltopdf
You can then use the following code in your "Dockerized" Python script:
import pdfkit
path_wkhtmltopdf = '/usr/bin/wkhtmltopdf'
config = pdfkit.configuration(wkhtmltopdf=path_wkhtmltopdf)
pdfkit.from_string(html, '<direction/of/the/report.pdf>', configuration=config)