The business use case
An organization wants to provide a mechanism to its customers to dynamically populate their demographic data from some other 3rd party system to an offline PDF form, thus saving their customers a lot of time, providing a better experience and automating the form fill-up process.
1. AEM 6.4+
2. Forms Add-on
3. AEM Maven project should have the following dependencies (artifactId)
4. Acrobat PDF license to edit the PDF files
The solution is to use AEM Forms technology by leveraging the Forms API to automatically merge the XML with the existing PDF forms.
Prepare the offline PDF for merge functionality to verify whether the field names in the PDF meet the XML specification with respect to XML tag naming. The field names in the PDF correspond to the XML tag names. This can be done by the following steps —
a) Open the PDF file in Adobe PDF reader.One should have the license to also edit the PDF
b) Select the option Edit the PDF from the right side pane in the PDF reader and this will open the file for editing.
c) Once the file is open for editing, select File menu -> Create -> Create Form -> click on Start button
d) This will make all the fields of the PDF visible on the right side pane as a tree structure where one can edit the actual names of the fields and make the field names to meet the XML
tag naming specification e.g. field names should not have a ‘ ’ in their names because XML tags should not have a space in their name. In case the field names are found to have ‘ ‘ in their names, a good practice would be to just replace them with a character such as ‘_’ or delete the ‘ ‘ altogether. The field During the lease could be converted to During_the_lease or DuringTheLease, etc.