question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

wkhtmltopdf support

See original GitHub issue

Hey, When i was trying to install pdfkit through pip, it gave error of

No wkhtmltopdf executable found: "" If this file exists please check that this process can read it.

So can’t i just use it using pip?

More, i installed the wkhtmltopdf using apt-get, but using pdfkit in celery to run multiple asyncronus tasks, it gives error of QXcbConnection: Could not connect to display I got that it is not getting xvfb display windows available in server, so any solution which I can solve into python level itself ?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

17reactions
jakewinscommented, Jun 1, 2017

For future travelers, the solution recommended by Debian now is to use xvfb. We wrote a subclass of the PDFKit class to achieve that:

import pdfkit

class HeadlessPdfKit(pdfkit.PDFKit):
    def command(self, path=None):
        return ['xvfb-run', '--'] + super().command(path)

pdf = HeadlessPdfKit("<html></html>", 'string').to_pdf(False)
3reactions
mrshucommented, Mar 27, 2018

For anyone who would appreciate @jakewins’ wrapper as a full fledged package, I’ve put it together here: https://pypi.org/project/headless-pdfkit/

Enjoy!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reporting Issues - wkhtmltopdf
When reporting an issues, please include the following information: wkhtmltopdf ...
Read more >
wkhtmltopdf
wkhtmltopdf and wkhtmltoimage are open source (LGPLv3) command line tools to render HTML into PDF and various image formats using the Qt WebKit...
Read more >
GitHub Docs Status Support Downloads - wkhtmltopdf
All downloads are currently hosted via GitHub releases, so you can browse ...
Read more >
GitHub Docs Status Support Downloads - wkhtmltopdf
Although Qt 4.5 enhanced the QtWebKit API, the focus wasn't on the HTML to PDF ...
Read more >
Documentation - wkhtmltopdf
At the moment, we only have the auto generated documentation for wkhtmltopdf.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found