So it doesn't take much searching of the net to find that iText was never ported to PHP and that the solutions for manipulating PDFs in pure PHP are rather poor.
This is the closest I've found to someone doing it in pure PHP: http://www.pdfhacks.com/forge_fdf/
Problem is, the script is SEVEN YEARS OLD. Is it that hard to do? Has anyone tried or knows someone who has tried and can share their war story?
If something PHP-friendly could be included in-module (or downloaded via a Drush command/manually), that'd be best for the community. Fill PDF Service could co-exist with this, since some people might want to offload the processing a bit, but it's always been a bit of a workaround.
The goal of this issue is to figure out if another way exists yet, so chime in please.
Comments
Comment #1
wizonesolutionsIt's not PHP, but I found this CAM:PDF-based utility http://search.cpan.org/dist/CAM-PDF/bin/fillpdffields.pl.
Grabbing a Perl script would be easier for many people than installing software on their servers. In fact, it might even work on shared hosting!
Chew on that for a second.
Comment #2
wizonesolutionsThere doesn't seem to be a feasible way to do this without writing a LOT of code, something I shouldn't promise because I don't have the time, and honestly, I don't want to write that much code un-sponsored because other than lots of street cred, there isn't much of a way for me to cash in on the effort involved :)
Translation: If you'd like this, sponsor it (or at the very least, comment on this issue and express interest). Otherwise, stick to Fill PDF Service for now. With SSL support in place, any security concerns of the past should be addressed now.
Postponing.
Comment #3
wizonesolutionstagging
Comment #4
liam morlandAll this does is generate an FDF file. You still need to use something like pdftk to put the values into the PDF. FillPDF's XFDF generation code does the same thing already.
Comment #5
wizonesolutionsThis is not PHP-based, but it could at least serve as a replacement to the Tomcat + PHP/JavaBridge solution: http://techpanacea.blogspot.com/2008/07/itext-with-ruby-on-rails-using-r...
It's basically RJB, a.k.a. Ruby JavaBridge. So it's still a bridge, but one that I could perhaps call with PHP's exec() function from the command line, similar to pdftk.
If anyone wants to look into this at some point and what's involved, give a shout. http://github.com/wizonesolutions/fillpdf-service already has the iText + Java part, which should be functional...but would probably need to be something other than a WAR. Not sure if RJB still needs something like Tomcat.
Comment #6
wizonesolutionsThe only solution of which I'm aware is to use SetaSign's tools. I'm slowly working with them to get this to happen. Their tools cost, but for people who want to keep things in PHP and on their server, they could be a viable alternative. I'll hopefully get a kickback when people do that, and that will help fund development.
Closing this and will open a separate issue when I work on that.