“wkhtmltopdf and wkhtmltoimage are open source (LGPL) command line tools to render HTML into PDF and various image formats using the QT Webkit rendering engine. These run entirely “headless” and do not require a display or display service.” Source: http://wkhtmltopdf.org/
There are two options:
wget http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.2.1/wkhtmltox-0.12.2.1_linux-centos6-amd64.rpm
rpm -Uvh wkhtmltox-0.12.2.1_linux-centos6-amd64.rpm
yum --enablerepo=clearos-core install PUTNAMEOFDEPENDENCYHERE
wkhtmltopdf http://wkhtmltopdf.org/ wkhtmltopdf-test.pdf
which wkhtmltopdf
which will report something like:
/usr/local/bin/wkhtmltopdf
Experimental. Unless you know what you are doing, use the patched QT option above
The qtwebkit version is useful to check when there is a bug:
1.- Login to your ClearOS via SSH.
2.- Make sure epel-release in an active repo
rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm?
3.- Activate ClearOS core repo
# In the marketplace (https://example.org:81/app/marketplace), activate the "Software Repository" app # https://example.org:81/app/software_repository # click "Detailed view" # Click "Toggle" on the clearos-core line
4.- Enable Okay.com.mx repository by running rpm accordingly:
For 32 bits:
rpm -ivh http://repo.okay.com.mx/centos/6/i386/release/okay-release-1-1.noarch.rpm?
For 64 bits:
rpm -ivh http://repo.okay.com.mx/centos/6/x86_64/release/okay-release-1-1.noarch.rpm?
5.- Type:
yum install wkhtmltopdf
once yum finishes the dependency Resolution it will show you a summary and will ask you to confirm.
6.- Confirm with y, yum will download and install the required rpms and will inform o the completion.
7.-Install the Xvfb (X Virtual Frame Buffer) type:
yum install xorg-x11-server-Xvfb
and confirm installation with “y” and wait for completion.
8.- To use, include within the xvfb execution: Example:
xvfb-run --server-args="-screen 0, 1024x768x24" wkhtmltopdf http://google.com google.pdf__
Output is visible with any reader application.
9- Make a wkhtmltopdf.sh to simplify Create a file /usr/local/bin/wkhtmltopdf.sh containing the following“
xvfb-run -a -s "-screen 0 1024x768x24" wkhtmltopdf "$@"
Using the command
wkhtmltopdf.sh http://tiki.org tiki.pdf
To test:
/usr/local/bin/wkhtmltopdf.sh
as WebKit path in the tiki administration page