Install PDFTK on a shared web server

My websites are hosted on Total Choice hosting, using some kind of Linux (I don’t know which option) and Apache. I do not have access to the command line - I can only run command line programs through exec () in PHP or through CRON jobs.

Is it possible to install and use PDFTK in such a system?

If so, what exactly do I need to do? Which files do I need to copy to where? Do I need to rebuild the PDFTK from the source code, or is there an executable version somewhere?

Since (as I understand it) PDFTK is based on iText, which is written in Java. Maybe I better use the original iText package?

Or is there a better way to do what I want to do (is it basically merging and smoothing a PDF file (empty form) with an FDF file (field value) into a new PDF file (filled form) and downloading it to the user)? Is there any native PHP or Python or Perl code?

Thanks - Rowan

+3
source share
2 answers

A quick glance shows that the source of the PDFTK is C ++, and it looks like they are using GCJ to compile some third-party Java code into native code. If you find a pre-built version of PDFTK that matches your OS and architecture, you can simply download the binary to your system and run it with PHP using exec. On the install additional assembly page are available.

There are some proprietary PHP libraries available for creating and processing PDF files. Check TCPDF , Zend_Pdf, and FPDF to see if you can use them. Everyone must support what you want to do, it is a matter of choosing the right solution.

Using PDFTK may be the fastest option since it is compiled code, but it is the least portable option because it requires that the software be installed on the server where PHP solutions could be distributed along with your code.

+4
source

If you are on a shared host, you cannot install PDFtk because you do not have root access to install anything. You must have the host that it preinstalled. I use bluehost.com, but the time is not the best there. It works for now, but I'm going to switch to another host as soon as my site is completed. I had several outages that continued throughout the day.

0
source

All Articles