Skip to content

Error QXcbConnection: Could not connect to display #82

Closed

Description

@domzinhuu

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

Activity

  1. WilliamDenniss commented on Sep 23, 2017

    @WilliamDenniss

    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

  2. massood commented on Aug 7, 2018

    @massood

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

  3. slisznia commented on Nov 6, 2018

    @slisznia

    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.
    
    
  4. alexventuraio commented on Feb 20, 2019

    @alexventuraio

    Solution from @WilliamDenniss worked for me!

  5. Thornolf commented on Oct 1, 2019

    @Thornolf

    Wrapping with xvfb worked for me, thanks :)

  6. ad-kan commented on Apr 4, 2020

    @ad-kan

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

  7. JazzCore commented on Mar 19, 2021

    @JazzCore
    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...

  8. Sherkhan7 commented on Dec 3, 2021

    @Sherkhan7

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions