Description of problem: It appears that the build of wkhtmltopdf requires a running X server. I know it is possible to have this binary built in such a way that id does not require X to be running. Would it be possible to build it that way? Hopefully not many servers are running X. Version-Release number of selected component (if applicable): wkhtmltopdf-0.11.0-0.2.rc1.el7.1.x86_64 How reproducible: wkhtmltopdf hello.html hello.pdf wkhtmltopdf: cannot connect to X server
https://code.google.com/p/wkhtmltopdf/issues/detail?id=3 claims this requires some Qt support/patch. Its possible that never got upstreamed (pretty sure fedora/rhel Qt packages don't include the patch separately).
Adding my voice to this issue. Some people are finding unsavory workarounds for this (https://github.com/KnpLabs/snappy/issues/89) that could have negative impact down the road as software ages. The virtual x-server seems to be the most popular workaround. I ran into this issue within a Vagrant-powered Fedora development environment. Using the yum installer during provisioning to assemble everything, including wkhtmltopdf.
Looks like the original issue reference is no longer valid, seems the project has moved to http://wkhtmltopdf.org/ and https://github.com/wkhtmltopdf/wkhtmltopdf/issues and I don't see this issue documented there yet... hint hint. :) I do see some Qt-related forked projects under https://github.com/wkhtmltopdf/ but it's not clear to me offhand which commits (patches) wkhtmltopdf requires.
Working on a PHP extension which is mostly a bindings for this library, I encounter the same issue, X is mandatory While the init is properly called with use_graphics=0 From the code lot of things use __EXTENSIVE_WKHTMLTOPDF_QT_HACK__ This can be checked using #include <stdio.h> #include <wkhtmltox/pdf.h> int main (int argc, char *argv[]) { printf("Extended: %d\n", wkhtmltopdf_extended_qt()); return 0; } This currently returns 0 (which 1 seems needed)
Workaround: xvfb-run --server-args="-screen 0, 1024x768x24" /usr/bin/wkhtmltopdf ... options... but i highly recommand to compile without x support, as this solution is slow and completly unnecessary as other versions show.
I see it documented now at: https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2811 at least
No progress with this for over a year here@brhc nor at github ... ideas?
Ping.
Will this ticket be processed at some point? Status "New" since 2014?!