Booyah! Great Day @Work! (still < a bad day fishin’, of course! lol)

Wildstar_TheyChallengedUsYay It’s days like today that i love being a geek!  A client needs a new website with several input forms including two IRS Tax forms that users are required to fill out and electronically sign.  The non-tax forms are no-biggie, CGI, validate data and store in database – piece of cake!  The challenge is the tax forms, which need to be filled out online and stored both in a database AND as intact PDF forms. Pbm. is users can download the forms and fill them in w/Acrobat Reader, then they can save them to their computer.  They then would have to email them back to us. We would then need to purchase Acrobat Pro(tm) in order to pull out and save the data in the forms~!  This requires an extra step on the users’ part and purchasing extra software on ours.
Once again enter Good ol’ Perl and CPAN to save the day!  I found this little module on CPAN called CAM::PDF (Thank you Chris Dolan!) which at first blush appeared to do exactly what we want except for one small show-stopping pbm. – it does NOT provide the ability to update check-boxes, and IRS forms are FULL of, you guessed it – check boxes¡  I filed a bug (61354) with the module’s author and, of course, did not hear back from him today. So, in typical JimPossible fashion, I began to look at the code myself to determine WHY check boxes are silently ignored. Sure enough, that feature was never implemented. Suffice it to say, I spent the day hacking up this code and learning some of the intricacies of the (binary) PDF format and got it working very nicely! perl_cowboy
DR.Tuxrxlinux One of my fav. programming activities is to hack up an existing module and bend it to my will, automate something that would otherwise be manual, and then contributing the improvements back to the OpenSource community!  Now, we’ll be able to offer users a basic HTML version of the form with the required fields, they’ll enter their choices, and the data will get saved on our server and we’ll programmatically create a PDF form completely filled in and present that to them for their records and store the form along with the data!
Advertisements

One Trackback

Feel Free to Comment (Name/Email/Website optional):

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: