|
This paper presents a complete, generic framework for creating modifiable, flowing PDF forms, based on XML content and standard XSL templates. It requires no programming to generate dynamic, fill-able, custom PDF forms by mapping some RenderX XSL FO extensions to form elements. Recently RenderX has seen many opportunities arise for creating “dynamic” forms. We mean dynamic because both the shape and the content of the form may depend on the actual content. This paper presents a method used for generating dynamic forms using RenderX’s XEP, an XSL FO formatting engine, combined with the iText library for PDF manipulation to produce dynamic, fill-able, custom forms in a high-volume, multi-threaded application. Potential Applications There are 1000s of potential applications that would benefit from such a solution. One real-life RenderX customer is creating over 100,000 monthly statements in PDF to be e-mailed to their customers. What is unique is that each statement is in reality a custom PDF Acroform for credit card submittal. The fields of the form must flow to any location in the document to be at the end of the statement and they must carry specific information in hidden fields. This includes such things as the account number, the amount, and the recipient’s name and address. The RenderX customers’ monthly statement run creates these dynamic, custom forms for presentation to the recipient through their on-line portal – not only as a “green” initiative but also providing a very convenient (and in many cases a more expedient) method for obtaining payment. They already were producing statements using XSL FO, the methods presented here allow them to dynamically generate unique custom forms for every recipient. Another example customer is creating a dynamic insurance application form that is 100% custom to the applicant. The form is generated using information from a few upfront questions and known information from the customers’ account. Whole sections and/or specific questions are included depending on the known information about the particular user (like previous insurance products, state of residence, etc.). Other fields are filled with known information and even hidden to prevent their modification. Based on a few simple questions asked at the web site, a dynamic form is generated on-demand that is custom for the applicant. The overall application process is streamlined, forgoing the many different applications for different types of users for one process to generate a custom form. It also eliminates mistakes and saves a lot of time for known prospects by pre-filling in information as well as hiding fields that should not be changed.
The Benefits of XSL FO for the Document and iText for the Form XSL FO, a W3C standard for representing print information in a standard XML language, is a technology that is well suited to creating flowing text documents through no use of programming. However, XSL FO contains no structures for supporting input of information such as a form field. The iText library is an ideal solution for enhancing and modifying existing PDFs and in this case it is used for its ability to stamp form fields onto existing PDF documents given a known location and page. Thus, one can use the ease of XML and XSL technology to compose PDF documents, while leveraging information from the RenderX XEP software during the composition phase to record the physical locations on the page for the form fields. RenderX is used to generate a “blank” PDF, one that would be a background as if the form fields where in the document. During the process, RenderX can record information about each of these fields – names, exact locations, pages, and other properties. A post-process of the resulting “blank” PDF and the form field information (obtained from the formatting process) using iText completes the application, creating a fully “dynamic” form with fields perfectly located within the document. The sample application created to demonstrate this capability has two classes. One creates the “background” form using RenderX software and records the information needed. The second class stamps the fields using iText. A standard set of templates in XSL completes the application. They are used to transform an XML element representing a form field. For the production application, the two classes were wrapped into a multi-threaded framework. The results were very high-speed production of totally custom form documents from source XML content and XSL instructions. The most important benefit of this solution is that it creates a complete, generic framework with modifiable form field elements, based on XML content and standard XSL templates. No further programming is necessary to generate dynamic, fill-able, custom PDF forms.
|