You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error QXcbConnection: Could not connect to display #82
I use django v1.11.1, wkhtmltopdf 0.12.2.4 and pdfkit 0.6.1, i think that i have conflict, when i use wkhtmltopdf google.com google.pdf in my terminal this work fine, but when i use in my app i get this error
wkhtmltopdf exited with non-zero code -6. error:
QXcbConnection: Could not connect to display
You'll want either wkhtmltox-0.12.4_linux-generic-amd64.tar.xz or wkhtmltox-0/usr/bin/.12.4_linux-generic-i386.tar.xz. Then copy the binary from wkhtmltox/bin to /usr/bin/ and you're done. It's also a newer version of wkhtmltopdf to boot.
Reduced Functionality:
This version of wkhtmltopdf has been compiled against a version of QT without
the wkhtmltopdf patches. Therefore some features are missing, if you need
these features please use the static version.
Currently the list of features only supported with patch QT includes:
* Running without an X11 server.
Activity
WilliamDenniss commentedon Sep 23, 2017
Here's a relevant stack exchange question: https://unix.stackexchange.com/q/192642/215718
What I recommend is don't use the Debian package (which doesn't support running headless). Grab the latest generic linux binary here: https://github.com/wkhtmltopdf/wkhtmltopdf/releases/tag/0.12.4
You'll want either
wkhtmltox-0.12.4_linux-generic-amd64.tar.xzorwkhtmltox-0/usr/bin/.12.4_linux-generic-i386.tar.xz. Then copy the binary fromwkhtmltox/binto/usr/bin/and you're done. It's also a newer version of wkhtmltopdf to boot.Or you can use
xvfbto wrap it as described here https://github.com/JazzCore/python-pdfkit/wiki/Using-wkhtmltopdf-without-X-server#debianubuntumassood commentedon Aug 7, 2018
The wrapper script didn't work for me. But the binary from the GitHub release page did.
slisznia commentedon Nov 6, 2018
Note about wkhtmltopdf (0.12.4) in Ubuntu 18.04:
alexventuraio commentedon Feb 20, 2019
Solution from @WilliamDenniss worked for me!
Thornolf commentedon Oct 1, 2019
Wrapping with
xvfbworked for me, thanks :)ad-kan commentedon Apr 4, 2020
The solution from @WilliamDenniss works perfectly. Thank you so much.
JazzCore commentedon Mar 19, 2021
Closing since its "fixed". Good idea to update wiki page about running without X server with an alternative binary from https://github.com/wkhtmltopdf/wkhtmltopdf/releases/
Sorry that it took so long for me to get to it...
Sherkhan7 commentedon Dec 3, 2021
Solution from @WilliamDenniss worked. Thank you ;) I tested on ubuntu 18.04