Wanted: Perl PDF Advice
I’m really starting to hate Adobe and PDFs in general. Hopefully somewhere out there of my faithful few can point me in the right direction.
What I need to do is take data input from a web form or database and incorporate that into an already existing PDF, and then send the resulting PDF back to the user, through a unix based system (linux+apache).
This is for filling in forms and whatnot and the only gotcha is that the resulting PDF has to be downloadable by the user. I understand that the FDF data format is what I should be looking at, but as I understand it the output can only be viewed online.
The Adobe pages are less than helpful and while they have nice dowloadable SDKs, they all appear to be java based. There is a surprisingly little amount of information on google or CPAN about all this. I know that PHP has some functions for this but again, I’m looking for something really simple and braindead.
What I’m asking for can’t be that hard can it?
Update Thanks for the replies folks. However I have to reiterate… I’m not trying to convert something to or from PDF, I’m trying to insert form field data into an existing PDF and then having that available for download as a PDF. IE: [User Data] + [PDF with Form Fields] = [PDF] 🙂 The [PDF with Form Fields] is something that the company I’m working with will supply, and I do not plan on taking the weeks/months required to turn them from PDFs to Perl code with something like PDFLib (Shaggy, that was the first thing I thought of when I got this project, and quickly realized that it wouldn’t work). Though the PDI might work. I don’t care about if this is a pay-for library (not my money) as long as there’s a demo of some sort available so that I can try it out!
Well, not to sound discouraging, but we did that at my old workplace with ASP and it was a bitch and a half.
So if you do manage it, you are a great golden god and I’ll leave offerings of ambrosia (or at least Guinness) at your feet.
I’ve used ImageMagick and png2pdf in the past…
Try doing a search for PDF on freshmeat — a quick search showed some stuff that could be promising.
I know this isn’t quite the answer you’re looking for, but we do this all the time. Using Crystal Enterprise, it’s a breeze to output reports to PDF, HTML, Excel, Word, ODBC, Crystal Reports, Text, XML, etc… and still have tons of control over the layout, fonts, etc.
I can show you via a webex if you want…
goto cpan search for pdf 🙂 depending on what you are starting with check into the *2pdf converters. some are pretty good.
Remember here we used PDFLib. It wasn’t too bad to use to create PDF’s and had many different API’s for many different languages. I believe that there is also a PDI, a PDF Import Library, that you can use, though I have no experience with that. All the PDFs I’ve create have been from scratch, recreating an existing PDF by hand……fun!! Oh yeah, I don’t think this software is free for commercial use.
Here’s a PHP library that might get you started:
http://phpwebtools.sourceforge.net/
Shaggy, that was the first thing I thought of when I got this project, and quickly realized that it wouldn’t work. Though the PDI might work. I don’t care about if this is a pay-for library (not my money) as long as there’s a demo of some sort available so that I can try it out!
I suggest that u transform u pdf into a image and use it with PDFLib, u can use PDFlib Lite without worries about licencing.
And PDI is damned expensive to get :/
Here we hired to a guy to create the company forms into PHP + PDFLib and use them (internally, of course) and we don’t need to pay the 1K they want for the lisence.
And, anyway, you need to put the texts in the right places, wich IMHO is a harder task than making all the form.
Hello,
try searching on perl FDF, (foxtrot – delta – foxtrot) as opposed to PDF. I am currently
evaluating forms data format input instead
of regular HTML GET/POST form elements.
Also check out this CPAN reference to FDF (fleetingly)
http://search.cpan.org/~larslund/PDF-Reuse-Tutorial-0.08/Tutorial.pm
Stephen
Adobe have a form library available for
download from
http://partners.adobe.com/asn/acrobat/forms.jsp
You have to register with Adobe first, its free
but once your registered you can use their C/Perl
libraries for Windows and Unix.
Stephen
Hi, considering this was six months ago, it’s probably too late, but I did exactly this for a client and I used a perl library called PDF-Everywhere. Its other name is PDFever. It’s some guy in Canada. It cost a bit of money. It uses xml files and reads them for content to then combine into an existing pdf. Your form could create the xml files.
I’m trying to find a good free perl library for creating pdf files dynamically, and haven’t found it yet…