Bug 1140279

Summary: wkhtmltopdf requires running X
Product: [Fedora] Fedora EPEL Reporter: Erinn Looney-Triggs <erinn.looneytriggs>
Component: wkhtmltopdfAssignee: Lubomir Rintel <lkundrak>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: epel7CC: customercare, fedora, frank.duerr, lkundrak, marc, projects.rg, rdieter, vurcease
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-07-08 22:03:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Erinn Looney-Triggs 2014-09-10 15:49:40 UTC
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

Comment 1 Rex Dieter 2014-09-10 16:09:23 UTC
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).

Comment 2 Adam Bellas 2015-01-03 19:44:07 UTC
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.

Comment 3 Rex Dieter 2015-01-03 20:03:20 UTC
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.

Comment 4 Remi Collet 2017-11-11 11:08:29 UTC
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)

Comment 5 customercare 2018-01-08 16:20:22 UTC
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.

Comment 6 Rex Dieter 2018-01-08 16:37:04 UTC
I see it documented now at:
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2811
at least

Comment 7 customercare 2019-04-08 15:10:06 UTC
No progress with this for over a year here@brhc nor at github ... ideas?

Comment 8 Raphael Groner 2020-03-16 22:27:20 UTC
Ping.

Comment 9 Frank Duerr 2020-11-24 15:25:43 UTC
Will this ticket be processed at some point? Status "New" since 2014?!

Comment 10 Troy Dawson 2024-07-08 22:03:36 UTC
EPEL 7 entered end-of-life (EOL) status on 2024-06-30.\n\nEPEL 7 is no longer maintained, which means that it\nwill not receive any further security or bug fix updates.\n As a result we are closing this bug.

Comment 11 Red Hat Bugzilla 2024-11-06 04:25:03 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days