[BNM] PHP Generated or Filled PDF Forms

36 views
Skip to first unread message

Leo Brown

unread,
Mar 18, 2009, 6:31:57 AM3/18/09
to Brighton New Media
Hi list

I've seen a bunch of discussions on this but nothing that exactly matches or
helps.

We want to change our Direct Debit structure so that the paper mandates are
either easily filled in PDF forms to be printed, or better yet, pre-filled
by PHP as PDF forms, making it a super-easy process.

Here's an example of something I thought would help:
http://koivi.com/fill-pdf-form-fields

Except it's not exactly inspiring that it doesn't work. And you have to make
the PDFs manually rather than generate them, which I was hoping to avoid,
but since FPDF etc don't support forms, I think I'll have to let this one
go.

Oh, and the code hasn't been maintained for 3 years and the author says he's
tired of people to ask how to make it work so he's just put up the source
code :)

Just wondering if anyone's got any similar solutions they've used before, or
if you have a similar need we could join forces...

Leo

--

BNM Subscribe/Unsubscribe:
http://www.brightonnewmedia.org/options/bnmlist

BNM powered by Wessex Networks:
http://www.wessexnetworks.com

Wayne Douglas

unread,
Mar 18, 2009, 6:35:44 AM3/18/09
to Brighton New Media
Crystal reports are shit to work with but are quite good at pumping out
large amounts of PDFs for things like this.
I coded a billing system for a telecoms company a few years ago using
Crystal and it dished out millions of PDF bills each cycle for email
notifications no worries.

Not 100% about the whole forms thing as I haven't worked with it for ages
but would have thought it'd be capable of doing this...

hth

w://


2009/3/18 Leo Brown <li...@acumendevelopment.net>


--
Cheers,

w://

paul perrin

unread,
Mar 18, 2009, 7:08:40 AM3/18/09
to Brighton New Media
I'd approach it the other way round.

Write a bog standard PDF form that initally populates itself and then
lets the user edit/save/send/print.

I guess the initial population could be from the query string, or the
form could do a get the very first time it is opened (if it fails, no
defaults -- not fatal).

Paul /)/+)

2009/3/18 Leo Brown <li...@acumendevelopment.net>:

Leo Brown

unread,
Mar 18, 2009, 7:15:48 AM3/18/09
to Brighton New Media
Hi

Ah ok. I think I'm trying to approach the same way you're suggesting. And
the only way you can auto-populate PDF forms that I know of is using this
XDF syntax. I downloaded the source on koivi.com, and noticed there was a
tutorial, which matches this approach:

http://koivi.com/fill-pdf-form-fields/tutorial.php

Opened a draft direct debit mandate sent to me by my bank in Word, printed
it via Office for Mac to PDF, and then opened the PDF in Acrobat Pro.
Acrobat had an 'auto detect form' option, and it successfully detected every
bloody field, with correct font size, correct label, everything.

Only mistake it made was trying to make a form field out of the signature
field, which obviously we can't do.

It's rare that computing really seems to behave as well as we think it
should, but lovely when it happens!

Leo

andrew...@gmail.com

unread,
Mar 18, 2009, 8:03:51 AM3/18/09
to Brighton New Media
Leo,
Hello. I've used fpdf (http://www.fpdf.org/) a couple of times in the
past to generate pdf files on the fly.

And there appears to be an fpdf extension to create pdf forms. A big
downside is that it's in German (all documentation in german) so i may
be barking up the wrong tree!

http://www.cix-blog.de/Blog-Projekt-FPDF-AcroForm.html

Hope this might help.

cheers,
Andy Gill

Leo Brown

unread,
Mar 18, 2009, 8:13:25 AM3/18/09
to Brighton New Media
Andy

Thanks for that. Wish I found the PDF extension for making forms previously.
I've done them all now in Acrobat pro - oh well, it wasn’t too hard. Have
bookmarked it for next time!

Leo Brown

unread,
Mar 18, 2009, 9:16:13 AM3/18/09
to Brighton New Media
Guys

For the record, is made and works fairly nicely, I believe.

http://mandate.proto1.acumensystems.net

Can generate data in PHP (or this case HTML) and then can still edit in the
PDF.

Thanks for assistance!

paul perrin

unread,
Mar 18, 2009, 10:46:29 AM3/18/09
to Brighton New Media
FWIW: I was suggesting a PDF with embeded script to populate itself
(maybe from query string parameters) - this way it can still be used
off-line.

Using an FDF you need web connection to pull in the form when it is activated.

Whether this matters will depend on your application!

Paul /)/+)

p.s. Had a look at your form in chrome, filled it in, it
created/downloaded an FDF, opening this launched acrobat, which then
launched MSIE(!).

2009/3/18 Leo Brown <li...@acumendevelopment.net>:

Leo Brown

unread,
Mar 18, 2009, 10:49:05 AM3/18/09
to Brighton New Media
Paul

Gotcha! No, this is online really as the data is generated from the site for
a one-off mandate print. Thanks again for all your input, think I'm there!

L

Jay Caines-Gooby

unread,
Mar 18, 2009, 10:51:33 AM3/18/09
to Brighton New Media
On Wed, Mar 18, 2009 at 2:46 PM, paul perrin <pa...@idltd.com> wrote:
> FWIW: I was suggesting a PDF with embeded script to populate itself
> (maybe from query string parameters) - this way it can still be used
> off-line.
>
> Using an FDF you need web connection to pull in the form when it is activated.
>
> Whether this matters will depend on your application!
>
> Paul /)/+)
>
> p.s. Had a look at your form  in chrome, filled it in, it
> created/downloaded an FDF, opening this launched acrobat, which then
> launched MSIE(!).

FYI: on my Mac, the FDF made Acrobat go nuts and keep asking whether
it was OK to trust the website before opening another version of
Acrobat which asked the same question ad-infinitum.

--
Jay Caines-Gooby
j...@gooby.org
+44 (0)7956 182625
twitter, skype & aim: jaygooby
gtalk: jayg...@gmail.com

Leo Brown

unread,
Mar 18, 2009, 10:58:49 AM3/18/09
to Brighton New Media
Yep, thought there'd be some weirdness to find. Sorry for crashing your machine, will put it out for beta testing in a smaller group first ;)

Ta,
Leo

-----Original Message-----
From: bnmlist...@brightonnewmedia.org [mailto:bnmlist...@brightonnewmedia.org] On Behalf Of Jay Caines-Gooby
Sent: 18 March 2009 14:52
To: Brighton New Media
Subject: Re: [BNM] PHP Generated or Filled PDF Forms

paul perrin

unread,
Mar 18, 2009, 11:07:42 AM3/18/09
to Brighton New Media
:-))

2009/3/18 Leo Brown <li...@acumendevelopment.net>:

Reply all
Reply to author
Forward
0 new messages