Render web pages to image or PDF via (modified) WebKit.
web | etc


"Could not connect to display" when running headless

This an similar errors can occur when running headless (especially older versions on legacy distros):

QXcbConnection: Could not connect to display 

To solve, install and use xvfb:

xvfb-run -- /usr/bin/wkhtmltopdf [OPTIONS]

Reference: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2037

CC0 / Public domain dedication To the extent possible under law, d3vid seaward has waived all copyright and related or neighboring rights to "wkhtmltopdf in Grasmere notebook, including code snippets" (why? how?)