Table of Contents

wkTHMLtoPDF

“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:

How to install wkhtmltopdf patched QT on ClearOS

How to install wkhtmltopdf on ClearOS

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

Related links

search?q=clearos%2C%20kb%2C%20howtos%2C%20tiki%2C%20skunkworks%2C%20maintainer_dloper%2C%20maintainerreview_dloper&btnI=lucky