The Forms service lets you create interactive data capture client applications that validate, process, transform, and deliver forms that are typically created in Designer. The Forms service renders as PDF documents any form design that you develop.
Forms service also enables organizations to extend their intelligent data capture processes by deploying electronic forms as Adobe PDFs. You can also use the service to import and export data to and from existing PDF forms respectively.
Use the Forms service to do the following:
Use Form service to create PDF Forms for data capture. Typically, you start with an AEM Forms Designer template. Use the renderPDFForm
(link to Javadoc) operation of the Forms service to convert this template to a PDF form.
The first parameter of the renderPDFForm
operation is the name of the template file (for example, ExpenseClaim.xdp
). You can store the template file in a local file system, CRX repository, or at an HTTP or FTP location. You can specify the location of the template file by setting the content root in the PDFFormRenderOptions
parameter of the renderPDFForm
operation. See Javadoc for details of other options that you can specify for the PDFFormRenderOptions
parameter.
The renderPDFForm
operation can also accept XML data. The XML data is merged with the template when creating a PDF Form so that the generated PDF form contains the specified data. The second parameter for the renderPDFForm
operation can accept a Document (Javadoc) object that contains XML data.
Use the exportData
(Javadoc) operation of the Forms service to extract data XML from a PDF form. This operation accepts a document as its first parameter. You can export the data either as an XDP document or an XML file. If you export the data as an XML file, the exported data removes the XDP envelope and returns a plain XML file. You can specify this arrangement using the second parameter.
Forms service also lets you merge a PDF form created using either AEM Forms Designer or the renderPDFForm
operation with XML data. The importData
(Javadoc) operation of Forms service accepts the PDF form and XML data and returns a PDF form with data XML.
Forms service can render forms based on fragments that you create using AEM Forms Designer. A fragment is a reusable part of a form. It is saved as a separate XDP file that can be inserted into multiple form designs. For example, a fragment can include an address block or legal text.
Using fragments simplifies and accelerates the creation and maintenance of large numbers of forms. When creating a form, insert a reference to the required fragment for the fragment to appear in the form. The fragment reference contains a subform that points to the physical XDP file.
The following are the advantages of using fragments: