Forums

wkhtmltopdf

Hi,

I am having an issue with wkhtmltopdf and pdfkit in my django app.

I am basically trying to convert an html to pdf using pdfkit and I am getting the following error:

OSError: wkhtmltopdf exited with non-zero code -6. error: QXcbConnection: Could not connect to display

I saw that this error already was discussed by some people here: https://www.pythonanywhere.com/forums/topic/2012/

I couldn't post to it since it's not part of the "eu" website, and I understood from it however that there are some sort of configuration from your side that could be done to my account?

Thanks for your support

No problem. I have enabled it for your account. New consoles will use the new system, your scheduled tasks will use it the next time they run. Always on tasks will use it after they've been stopped and started and web apps will use it when they are reloaded.

Thanks a lot, it's still not working however. I tried restarting everything, however I am still getting the following error:

OSError: wkhtmltopdf exited with non-zero code -6. error: QXcbConnection: Could not connect to display

Could you please advise on what should be done? If there are some steps that I missed or something?

Thanks a lot for your support.

Did you do this: https://www.pythonanywhere.com/forums/topic/2012/#id_post_82617?

Worked like a charm :) Thank you so much!

Hi @glenn i need to run wkhtmltopdf, can you turn on virtualization for my account, thanks !

All accounts have the required virtualisation setup for wkhtmltopdf now; what problems are you having when you try to use it?

It's working now. Everything I had to do, was to install it. For this I followed adinda's recipe: https://www.pythonanywhere.com/forums/topic/2012/#id_post_85335

Great, thanks for letting us know!