Saturday, May 12, 2018

Using pdfkit on Heroku


I recently set up a PDF rendering engine on Heroku using the Python library pdfkit. There was a bit of extra work to get pdfkit working on Heroku.

Step 1: Install the wkhtmltopdf buildpack

Step 2: Point pdfkit to the location of the wkhtmltopdf binary:

config = pdfkit.configuration(wkhtmltopdf='./bin/wkhtmltopdf')
pdf = pdfkit.from_string(html, False, options=options, configuration=config)

No comments:

Post a Comment