Pdftk? possible at all on DH?

Is it even possible at all to build pdftk? Or has anyone compiled gcj here and be willing to shoot me over a binary? I’m in need of a way to have a form populate a pdf and present it to the user, as well save those results for me.

This sample, http://accesspdf.com/html_pdf_form/pdf_form_interface.php works perfectly. It just requires pdftk and that requires gcj, using a binary for debian results in
./pdftk: error while loading shared libraries: libgcj.so.4: cannot open shared object file: No such file or directory
[nestea]$

Any ideas?

I’d love to be able to use pdftk on my site as well! Any ideas anyone?

did either of you ever find a solution for this other than upgrading to dreamhostps.com? I am about ready to pay a buddy to make a work around. Let me know if you want info.

I was never able to get it going. Boo.

i am paying someone to go ahead and make build just for dreamhost shared hosting… if that works then I would share that with you for $25 to go towards the cost if you want. If that doesn’t work I will have to upgrade to dreamhostph which is a min or 15 more a month. I will likely have to do that anyways but while I am developing and testing my app on a budget I want to avoid that.

I thought you had it going with just the link to the resultant file needing tweaking?

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost

I have found a pre-compiled package of PDFTK, which did not work by itself. But, after changing some PATH vars, it did.

The files can be downloaded here:
http://www.ziddu.com/download/5241623/pdftk_1.41_puppy_4.2.1.zip.html

You should simply open the ‘libgcj8-1_4.2.4-4_i386’ package and extract the lib folder to the destination of your choice (mine was /home/username/lib) and then point the PATH to it. After that, the binary on the pdftk should be running.

The necessary PATH changes are:

I have set my php scripts to run these export commands every time prior to pdftk, and it has worked just fine.

Hope this helps anyone.

later.

just followed you directions to the letter and it did nto work. getting a segfault when i try to execute pdftk from command line! help!

I have not run into this error, so I really don’t have much of an idea what might be the cause. Did you use the pre-compiled pdftk?

Here are the commands that will download and install pdftk to your account. This works as of the date of this posting (2011-07-13).

After the commands are run, you will be able to execute pdftk with:

~/bin/pdftk

Do not run this if the directory you are in contains a directory called “pdftk” as it will be deleted in the last step.

mkdir pdftk
cd pdftk
wget 'http://ftp.egr.msu.edu/debian/pool/main/p/pdftk/pdftk_1.41-3_i386.deb'
wget 'http://ftp.br.debian.org/debian/pool/main/g/gcj-4.2/libgcj8-1_4.2.4-4_i386.deb'
ar p pdftk_1.41-3_i386.deb data.tar.gz | tar zx
ar p libgcj8-1_4.2.4-4_i386.deb data.tar.gz | tar zx
mkdir ~/bin
mkdir ~/lib
cp -pr usr/bin/* ~/bin
cp -pr usr/lib/* ~/lib
mv ~/bin/pdftk ~/bin/pdftk.target
echo '#!/bin/bash' >> ~/bin/pdftk
echo "" >> ~/bin/pdftk
echo 'export PATH=~/bin:$PATH;' >> ~/bin/pdftk
echo 'export LD_LIBRARY_PATH=~/lib:/usr/local/lib:$LD_LIBRARY_PATH;' >> ~/bin/pdftk
echo "" >> ~/bin/pdftk
echo '~/bin/pdftk.target "$@"' >> ~/bin/pdftk
chmod +x ~/bin/pdftk
cd ..
rm -rf pdftk

(There are 20 lines of code and the last line is an “rm” command)

YES Shadow700! Thank you, thank you, thank you!!

So once you have installed it like that shadow700, then what do you do to make it run?

John

For future reference, here is an updated script for installing pdftk on dreamhost shared hosting (assuming that Dreamhost is still running Debian 5.0.9 (lenny)

mkdir pdftk
cd pdftk
wget 'http://archive.debian.org/debian/pool/main/p/pdftk/pdftk_1.41-3_i386.deb'
wget 'http://archive.debian.org/debian/pool/main/g/gcj-4.2/libgcj8-1_4.2.4-4_i386.deb'
wget 'http://backports.mithril-linux.org/pool/main/g/gcc-4.3/libstdc++6-4.3-dev_4.3.4-6~bpo50+1_i386.deb'
ar p pdftk_1.41-3_i386.deb data.tar.gz | tar zx
ar p libgcj8-1_4.2.4-4_i386.deb data.tar.gz | tar zx
ar p libstdc++6-4.3-dev_4.3.4-6~bpo50+1_i386.deb data.tar.gz | tar zx
mkdir ~/bin
mkdir ~/lib
cp -pr usr/bin/* ~/bin
cp -pr usr/lib/* ~/lib
mv ~/bin/pdftk ~/bin/pdftk.target
echo '#!/bin/bash' >> ~/bin/pdftk
echo "" >> ~/bin/pdftk
echo 'export PATH=~/bin:$PATH;' >> ~/bin/pdftk
echo 'export LD_LIBRARY_PATH=~/lib:/usr/local/lib:$LD_LIBRARY_PATH;' >> ~/bin/pdftk
echo "" >> ~/bin/pdftk
echo '~/bin/pdftk.target "$@"' >> ~/bin/pdftk
chmod +x ~/bin/pdftk
cd ..
rm -rf pdftk

to use pdftk - you can use passthrough or exec - the path to pdftk needs to be “~/bin/pdftk”

I will not be checking back or responding to PM re support for this script

With the update to the Dreamhost servers, it looks like gone to 64 bit, and my pdftk broke. Here is the modified code I used to get it working, using the latest stable releases. Note that libstdc++ is not required, which is cool since that link is broken anyway.

[code]
cd ~
rm -rf bin
rm -rf lib
rm -rf pdftk

mkdir pdftk
cd pdftk
wget 'http://ftp.us.debian.org/debian/pool/main/p/pdftk/pdftk_1.44-7_amd64.deb
wget ‘http://http.us.debian.org/debian/pool/main/g/gcj-4.6/libgcj12_4.6.3-1_amd64.deb

ar p pdftk_1.44-7_amd64.deb data.tar.gz | tar zx
ar p libgcj12_4.6.3-1_amd64.deb data.tar.gz | tar zx

mkdir ~/bin
mkdir ~/lib
cp -pr usr/bin/* ~/bin
cp -pr usr/lib/* ~/lib
mv ~/bin/pdftk ~/bin/pdftk.target
echo ‘#!/bin/bash’ >> ~/bin/pdftk
echo “” >> ~/bin/pdftk
echo ‘export PATH=~/bin:$PATH;’ >> ~/bin/pdftk
echo ‘export LD_LIBRARY_PATH=~/lib:/usr/local/lib:$LD_LIBRARY_PATH;’ >> ~/bin/pdftk
echo “” >> ~/bin/pdftk
echo ‘~/bin/pdftk.target “$@”’ >> ~/bin/pdftk
chmod +x ~/bin/pdftk
cd …
rm -rf pdftk[/code][/code]

when i try your suggestion, everything installs fine but i get the following error when running pdftk from the shell

/home/XXXX/bin/pdftk.target: error while loading shared libraries: libgcj.so.12: cannot open shared object file: No such file or directory

Make sure these files are in /home/XXXX/lib:
libgcj-tools.so.12.0.0
libgcj.so.12.0.0
libgij.so.12.0.0
libgcj-tools.so.12
libgcj.so.12
libgij.so.12

Thanks! That fixed the issue