mileszs / wicked_pdf

PDF generator (from HTML) plugin for Ruby on Rails
http://www.mileszs.com/wicked-pdf-plugin
MIT License
3.54k stars 647 forks source link

Upgrading to 1.1.0 fails with "The switch --footer-right, is not support using unpatched qt, and will be ignored" #803

Open zedtux opened 5 years ago

zedtux commented 5 years ago

I'm migrating a Rails 4 app to Rails 5 so I had to upgrade this gem too to the 1.1.0 version and since that I have the following error :

[ActiveJob] [Invoices::BaseJob] [ad4af7b3-cffc-445e-9e1f-8ab1fbf0899b] [Invoices::GenerationJob] [e902b51a-d077-4111-a59a-e03b217cd080] Failed to execute:
["/usr/bin/wkhtmltopdf", "-q", "--orientation", "Portrait", "--title", "Facture", "--footer-right", "Page [page] sur [topage]", "--footer-font-size", "7", "file:////tmp/wicked_pdf20190308-299-1bcr3ae.html", "/tmp/wicked_pdf_generated_file20190308-299-mo553y.pdf"]
Error: PDF could not be generated!
 Command Error: The switch --footer-right, is not support using unpatched qt, and will be ignored.The switch --footer-font-size, is not support using unpatched qt, and will be ignored.QXcbConnection: Could not connect to display

I'm running this on a Debian and I have installed wkhtmltopdf with apt-get install wkhtmltopdf.

Before the upgrade, it was working fine, and looking at your CHANGELOG.md file, I don't see anything that could explain what is happening.

Do you know about this issue and how I can fix it?

unixmonkey commented 5 years ago

@zedtux Did you also upgrade wkhtmltopdf or other system packages?

This error tells me that WickedPdf is still shelling out the right command, but wkhtmltopdf isn't supporting that option because it's missing some compile-time options in the binary.

If you are using a platform-as-a-service like Heroku, it may have changed your base system to something new.

You might need to track down or build a version of wkhtmltopdf for your platform that includes QT bindings.

Please let me know

zedtux commented 5 years ago

Hey @unixmonkey thank you for your comment.

I'm using Docker and my image is a Debian Jessie image where I'm installing it, as I said in my initial post, with apt-get install wkhtmltopdf, so the Debian version.

As of today it worked perfectly fine (Running Cucumber test printing an invoice) but doing the Rails 5 migration leaded me to this error.

On the Internet I found people doing a curl to the latest version from the wkhtmltopdf's github releases ... which I could do ... but I'm surprised that before the upgrade the tests were passing, and now they aren't. It could be a coincidence of course.