PDF Labs

Install PDFtk on Red Hat or CentOS

Install PDFtk Server on Red Hat Enterprise Linux (RHEL versions 5 or 6) or CentOS (versions 5 or 6). Download a binary RPM, build from a source RPM, or build from source code.

Here are three ways to install our command-line PDFtk Server on Red Hat Enterprise Linux or CentOS Linux:

Install from Binary RPM

This is the best choice for most people. First, download the RPM that fits your operating system:

Next, install libgcj, on which pdftk depends:

sudo yum install libgcj

Finally, install the pdftk RPM you downloaded:

sudo rpm -i pdftk-2.02-1.*.rpm

Build and Install from Source RPM

If you would like to build PDFtk Server for yourself, consider using our source RPM. You will build a binary RPM which you can then install as described above.

First, set up your RPM build environment. Keep in mind that you’ll be building the RPM as an ordinary user — not as root.

Next, install the tools you’ll need to build PDFtk Server:

sudo yum install gcc gcc-java libgcj libgcj-devel gcc-c++

Next, download our PDFtk Server source RPM:


They say you should never build RPMs as root. So perform this next step using an ordinary user account:

rpmbuild --rebuild pdftk-2.02-1.el6.src.rpm

Upon completion, you will find a binary RPM in the RPMS directory you created as part of the first step. Change into this RPMS directory and install the new RPM with:

sudo rpm -i pdftk-2.02-1.*.rpm

Build from Source Code

You can build and install PDFtk Server without using rpm as follows:

sudo yum install gcc gcc-java libgcj libgcj-devel gcc-c++

wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip

unzip pdftk-2.02-src.zip

cd pdftk-2.02-dist/pdftk

make -f Makefile.Redhat

sudo make -f Makefile.Redhat install

Upon completion, you will find pdftk in /usr/local/bin.

If you get a build error that says: gcj: Internal error: Killed (program jc1), it is possible that you don’t have enough computer memory. We have seen this error on virtual machines with just 1GB of RAM.

About PDF Labs

Our mission is to make PDF easier to use.

PDF Labs is operated by Sid Steward, author of PDF Hacks (O’Reilly) and the popular PDF Toolkit.

Please contact Sid Steward by email. Include PDF Labs in the subject to ensure prompt delivery:

About PDF Hacks

PDF Hacks Cover

"If you like pdftk, then you’ll appreciate the other 25 programs and scripts I created for my book, PDF Hacks." –Sid

About PDFtk

For ten years, power users have relied on PDFtk for server-side processing of PDF documents. Our command-line PDFtk has been — and always will be — free (as in freedom) software.

Today we also offer a convenient graphical application: PDFtk Pro. Your purchase of PDFtk Pro will help fund the continued development of our GPL PDFtk.

Thank you for your support!