I'm running pdftk, a program that deals with PDFs, on a shared server running Linux. Among its operations, it can rotate a pdf 180 degrees and fill a pdf form with .fdf data.
I've installed pdftk and have been able to run operations from the command line without any problem. I'm merging .fdf ata with a pdf form I've created and outputting to a folder on the server. This works great when run from the command line.
However, when I invoke pdftk through a php file in the browser to merge the .fdf data with the pdf, using the exact same script, the process hangs and eventually produces a 0KB pdf file instead of the ~28KB pdf produced when run from the command line. I let the program run its course and the checked my site's error log. Here is the error this
[Thu Mar 19 16:42:26 2009] [error] [client 22.214.171.124] sh: line 1: 8951 Killed /home/sweetbel/bin/pdftk-1
pdftk recipe_card_01.pdf fill_form test.fdf output /home/sweetbel/public_html
, referer: http://sweetbellpaper.com/pdf/
Code from my php file, with full and correct paths:
/pdftk recipe_card_01.pdf fill_form test.fdf output /home/sweetbel/public_html
Here's the funny thing ... my php file invoking pdftk works just fine when I'm using the "rotate pdf 180 degrees" operation (/home/sweetbel/bin/pdftk-
/pdftk recipe_card_01.pdf cat 1-endS output /home/sweetbel/public_html
). So it seems the conflict is with the fill_form operation itself.
Does anyone have a clue as to why this is happening?
passthru( '/home/sweetbel/bin/pdftk-1.41/pdftk/pdftk recipe_card_01.pdf fill_form test.fdf output /home/sweetbel/public_html/pdf/recipe_test.pdf' );