Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error QXcbConnection: Could not connect to display #82

Closed
domzinhuu opened this issue May 9, 2017 · 8 comments
Closed

Error QXcbConnection: Could not connect to display #82

domzinhuu opened this issue May 9, 2017 · 8 comments

Comments

@domzinhuu
Copy link

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

@WilliamDenniss
Copy link

WilliamDenniss commented 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.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.

Or you can use xvfb to wrap it as described here https://github.com/JazzCore/python-pdfkit/wiki/Using-wkhtmltopdf-without-X-server#debianubuntu

@massood
Copy link

massood commented Aug 7, 2018

The wrapper script didn't work for me. But the binary from the GitHub release page did.

@slisznia
Copy link

slisznia commented Nov 6, 2018

Note about wkhtmltopdf (0.12.4) in Ubuntu 18.04:

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.

@alexventuraio
Copy link

Solution from @WilliamDenniss worked for me!

@Thornolf
Copy link

Thornolf commented Oct 1, 2019

Wrapping with xvfb worked for me, thanks :)

@ad-kan
Copy link

ad-kan commented Apr 4, 2020

The solution from @WilliamDenniss works perfectly. Thank you so much.

@JazzCore
Copy link
Owner

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
Copy link

Solution from @WilliamDenniss worked. Thank you ;) I tested on ubuntu 18.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants