In Development Nothing is Certain…Except Paper.

In this world nothing can be said to be certain, except death and taxes. Benjamin Franklin is credited with this line to a letter to Jean-Baptiste Leroy in 1789.

I’ve learned that in the world of software development we could create a similar phrase about bugs and printable forms. No matter how far removed our society attempts to move away from printing paper, organizations, companies and government entities hold on to the idea that having a physical piece of paper in hand, means more. What this means in to developers is finding a way to take whatever you create electronically and be able to print it in a nice, readable format; sometimes under very strict formatting guidelines.

When this happens, I have found that using a library that allows print to PDF an extremely helpful tool. Currently, my favorite is called iTextSharp, which can be found through nuGet or through a download at source forge.

iTextSharp gives you a vast array of options when creating your PDF and I have had projects where we’ve done all of it: building html from scratch (which is slightly difficult due to the lack of CSS control), building reports and charts while working with MS Chart Control, over writing background images and simply editing an editable PDF. The last one, for me has proven the most helpful, especially in those forms where those strict guidelines exist.

The use of Adobe Live Cycle Enterprise Suite alongside iTextSharp cuts what used to be a painstaking process in half. You can take any PDF into Live Cycle and draw each type of input field (text box, text area, check boxes, radio buttons, etc.), label them and then in your back end code you can recall all of those fields and map them to data with iTextSharp. The final product is the exact form, in the exact format the client needs without the need for recreation or the time and effort to plot coordinates on a background image to try and match where data should go. Of course, you or your client still have to dedicate the time to creating the editable PDF, but it’s a pittance compared to other options I’ve found.

iTextSharp is far from perfect, but it goes a long way in taking a difficult, and certain task (in the software world) and making it much more manageable.