Generate Document of Record for Adaptive Forms (Core Components)
Overview overview
When a form is filled or submitted, you can keep a record of the form, in print or in the document format. This record is referred as a Document of Record (DoR). It is a print-friendly copy of the submitted form. You can also refer the document of record for the information customers have filled at a later date or use the Document of Record to archive forms and content together in PDF Format.
To create a Document of Record, an XFA or Acroform based template is merged with data collected via an adaptive form. You can generate a Document of Record automatically or on-demand. The on-demand option lets you specify a custom XFA or Acroform based template to provide a custom appearance to your Document of Record.
You can:
Before you start components-to-automatically-generate-a-document-of-record
Before you start learn and ready the assets required for a Document of Record:
Base template: An XFA template (XDP file) created in Forms Designer or an Acrobat Form (AcroForm). Base template is used to specify styling and branding information for a Document of Record. Upload your XFA template (XDP file) to your AEM Forms instance before.
Adaptive Form: An Adaptive Form for which the Document of Record is to be generated.
Generate an XFA-based Document of Record generate-an-XFA-based-document-of-record
Upload your XFA template (XDP file) to your AEM Forms instance. Perform the following steps to configure an Adaptive Form to use XFA template (XDP file) as template for Document of Record:
- In Experience Manager author instance, click Forms > Forms and Documents.
- Select a Form or Create an Adaptive Form, and click Properties.
- In the Properties window, select Form Model.
- On the Form Model tab, in the Select From drop-down, select Form Data Model, Schema or None. You can also select a form model when you create a form.
- In the Document of Record Template Configuration section of the Form Model tab, select Associate Form Template as Document of Record Template. On selecting this option, all XFA template (XDP files) available on your machine are displayed. Select the appropriate file. Also, ensure same schema (data schema) is used for Adaptive Form and selected XFA template (XDP file).
- Click Done.
Your Adaptive Form is now configured to use an XDP file as template for Document of Record. The next step is to bind Adaptive Form components with corresponding template fields.
Generate an Acroform-based Document of Record generate-an-Acroform-based-document-of-record
Upload your Adobe Acrobat PDF (Acroform) to your AEM Forms instance. Perform the following steps to configure an Adaptive Form to use Adobe Acrobat PDF (Acroform) as template for Document of Record:
- In Experience Manager author instance, click Forms > Forms and Documents.
- Select a Form or Create an Adaptive Form, and click Properties.
- In the Properties window, select Form Model.
- On the Form Model tab, in the Select From drop-down, select Form Data Model, Schema or None. You can also select a form model when you create a form.
- In the Document of Record Template Configuration section of the Form Model tab, select Associate Form Template as Document of Record Template. On selecting this option, all Acrobat PDF’s (Acroform) available on your machine are displayed. Select the Acroform you want to use.
- Click Done.
Your Adaptive Form is now configured to use an Acroform as template for Document of Record. The next step is to bind Adaptive Form components with corresponding template fields.
Automatically generate a Document of Record auto-generate-a-document-of-record
When an Adaptive Form is configured to automatically generate a Document of Record, every time a form is changed, its Document of Record is updated immediately. For example, if a field is removed from an existing adaptive form, the corresponding field is also removed and is not visible in the Document of Record. There are many other advantages of automatically generating Document of Record:
- Form developers do not have to maintain data bindings manually. Auto-generated Document of Record takes care of data binding related updates.
- Form developers do not have to manually hide fields which are marked exclude from Document of Record. Auto-generated Document of Record are pre-configured to exclude such fields.
- Auto-generated Document of Record option saves time required to create a Form template for Document of Record.
- Auto-generated Document of Record option lets you use different styling and appearances using different base templates. It helps select best style and appearance for Document of Record for your organization. If you do not specify styling, system styles are set as default.
- Auto-generated Document of Record ensures any change in form is immediately reflected in the Document of Record.
Perform the following steps to configure an Adaptive Form to automatically generate a Document of Record:
- In Experience Manager author instance, click Forms > Forms and Documents.
- Select a Form or Create an Adaptive Form, and click Properties.
- In the Properties window, select Form Model.
- On the Form Model tab, in the Select From drop-down, select Form Data Model, Schema or None. You can also select a form model when you create a form.
- In the Document of Record Template Configuration section of the Form Model tab, select Generate Document of Record.
- Click Done.
Bind Adaptive Form components with template fields bind-adaptive-form-components-with-template-fields
Bind Adaptive Form fields with template fields to display captured form data in corresponding Document of Record Field. To bind Adaptive Form components with corresponding document of record template fields:
-
Open the Adaptive Form, configured to use a custom form template for editing.
-
Select an Adaptive Form component and click open Configure icon. It opens properties browser.
-
In the properties browser, browse and select a field.
- (For AcroForm template) the Document of Record Bind Reference field property.
- (For XFA template) the Data Model Bind Reference property.
-
Click Save.
You can use submit actions such as “Send Email”, “Invoke an AEM workflow”, “Invoke a Power Automate flow”, and other Submit Actions to receive a Document of Record.
Incremental updates to Document of Record template document-of-record-template-incremental-updates
Adaptive forms and corresponding document of record templates can evolve over the period of time. You can choose to add, remove, or modify fields to an Adaptive Form or a Document of Record template.
When you change a Document of Record template and upload the changed Document of Record template to AEM Forms, the Adaptive Forms editor automatically detects the changed bindings and informs you about the adaptive form components that require new bindings. It lets you make incremental updates to a Document of Record template.
For example, an Organization, We.Retail, has an AcroForm-based Document of Record template, we-retail-invoice.pdf. The template looks like the following:
After using the template for some time, organization decides to rename invoice-number
field to bill-number
field and capture email address of buyers. A developer updates name of the invoice-number
field and adds an email field to the template. He also creates a new version of the template called we-retail-invoice-v2.pdf.
Now, when the Adaptive Form is submitted, an updated Document of Record of record is generated.
Key considerations when working with the Document of Record key-considerations-when-working-with-document-of-record
Keep in mind the following considerations and limitations when working on the Document of Record for Adaptive Forms.
- Document of Record templates do not support rich text. Therefore, any rich text in the static Adaptive Form or in the information filled in by the user appears as plain text in the Document of Record.
- Document fragments in an Adaptive Form do not appear in the Document of Record. However, Adaptive Form Fragments are supported.
- Content binding in the Document of Record generated for XML Schema based Adaptive Form is not supported.
- Localized version of Document of Record is created on demand for a locale when the user requests the rendering of the Document of Record. Localization of Document of Record occurs along with localization of Adaptive Form.
Mapping of Adaptive Form elements mapping-of-adaptive-form-elements
The following table describes Adaptive Form components and corresponding XFA components and if those appear in a Document of Record.
Fields fields
Containers containers
Static components static-components
Tables tables
The Adaptive Forms table components such as header, footer, and row map to corresponding XFA components. You can map repeatable panels to tables in Document of Record.
Base template of a Document of Record base-template-of-a-document-of-record
Base template provides styling and appearance information to Document of Record. It lets you customize default appearance of auto generated Document of Record. For example, you can use a base template to add your company logo in the header and copyright information in the footer of the Document of Record.
The master page from a base template is used as a master page for the Document of Record template. The masterpage can have information such as a page header, page footer, and page number that you can apply to the Document of Record. You can apply such information to the Document of Record using the base template for autogeneration of the Document of Record. Using a base template enables you to change the default properties of fields.
Always follow Base template conventions when you design base template.
Base template conventions base-template-conventions
A base template is used to define the header, footer, styling, and appearance of a Document of Record. The header and footer can include information like the company logo and copyright text. The first master page in the base template is copied and used as a master page for the Document of Record, which contains a header, footer, page number, or any other information that should appear across all pages in the Document of Record. If you use a base template which does not conform to base template conventions, the first master page from the base template is still used in the Document of Record template. It is highly recommended that you design your base template as per its conventions, and use it for auto-generation of Document of Record.
Master page conventions
-
In the base template, name the root subform as
AF_METATEMPLATE
and the master page asAF_MASTERPAGE
. -
The master page with the name
AF_MASTERPAGE
located under theAF_METATEMPLATE
root subform is preferred for extracting header, footer, and styling information. -
If
AF_MASTERPAGE
is absent, the first master page present in the base template is used.
Styling conventions for fields
-
To apply style on the fields in the Document of Record, the base template provides fields located in the
AF_FIELDSSUBFORM
subfrom under theAF_METATEMPLATE
root subform. -
The properties of these fields are applied to the fields in the Document of Record. These fields should follow the
AF_<name of field in all caps>_XFO
naming convention. For example, the field name for check box should beAF_CHECKBOX_XFO
.
To create a base template, do the following in Forms Designer.
-
Click File > New.
-
Select the Based on a template option.
-
Select the Forms - Document of Record category.
-
Select DoR Base Template.
-
Click Next and provide the required information.
-
(Optional) Modify the styling and appearance of fields that you want to apply on the fields in the Document of Record.
-
Save the form.
You can now use the saved form as a base template for a Document of Record. Do not modify or remove any scripts present in the base template.
Modifying base template
- Do not apply any styling over fields in the base template, it is advisable to remove those fields from the base template so any upgrades to the base template are automatically picked up.
- While modifying base template, do not remove, add, or modify scripts.
Strictly follow above mentioned conventions and instructions to design a base template.
Customize the branding information in Document of Record customize-the-branding-information-in-document-of-record
While generating a Document of Record, you can change branding information for the Document of Record on the Document of Record tab. The Document of Record tab includes options such as logo, appearance, layout, header and footer, disclaimer, and whether or not you want to include unselected check box and radio button options.
To localize the branding information that you enter in the Document of Record tab, ensure that the locale of the browser is set appropriately. To customize the branding information of Document of Record, perform the following steps:
-
Select a panel (root panel) in the Document of Record and then select .
-
Select . The Document of Record tab appears.
-
Select either the default template or a custom template for rendering the Document of Record. If you select the default template, a thumbnail preview of the Document of Record appears below the Template drop-down.
-
Based on whether you select a default or a custom template, some of the following properties, or all properties, appear in the Document of Record tab. Specify the below mentioned properties to define the appearance of the Document of Record:
-
Basic Properties:
-
Template: If you want to select a custom template, browse and select an XDP on your AEM Forms server. If you want to use a template that is not available on your AEM Forms server, you should first upload the XDP to your AEM Forms server.
-
Accent Color: The color in which header text and separator lines are rendered in the document of record PDF.
-
Font Family: Font family of the text in the Document of Record PDF.
note note NOTE AEM Forms offers a variety of built-in fonts that seamlessly integrate with PDF files. To see the list of supported fonts, click here. -
Include form objects that are not bound to data model: Setting the property includes unbound fields from Schema based Adaptive Form in the Document of Record.
- Hide description of panels: Setting the property excludes description of the panel/table from the Document of Record. Applicable for panel and table.
-
-
Form Field Properties:
- For Check Box and Radio Button components, show only the selected values: Setting the property displays only selected values of check box and radio button in Document of Record.
- Separator for multiple value(s): You can choose any separator such as comma or line break to display multiple values.
- Options Alignment: You can select the desired alignment (Horizontal, Vertical, Same as adaptive Form) to set the alignment for the fields such as check box or radio button to be displayed on Document of Record. By default, the vertical alignment is set for the fields in Document of Record. Setting the properties from the Form Field Properties of DoR overwrites the properties set in the Item Alignment for the fields on an Adaptive Form. In case, you select Same as Aaptive form option, the alignment as configured in an Adaptive Form author instance is used for Document of Record fields.
- Number of options for horizontal alignment:You can set the number of options to be displayed on the Document of Record for the horizontal alignment.
-
Master Page Properties:
- Logo Image: You can either choose to use the logo image from the Adaptive Form, choose one from DAM, or upload one from your computer.
- Form Title: Title of the DoR.
- Header Text: Text that appears at the header section of the Document of Record.
- Disclaimer Label: Label of disclaimer.
- Disclaimer: Text which specifies the scope of rights and obligations on the Document of Record.
- Disclaimer Text: Text of disclaimer.
note note NOTE If you are using an Adaptive Form template created with a version of Designer prior to 6.3, for Accent Color and Font Family properties to work, ensure that the following is present in your Adaptive Form template under the root subform: code language-xml <proto> <font typeface="Arial"/> <fill> <color value="4,166,203"/> </fill> <edge> <color value="4,166,203"/> </edge> </proto>
-
-
To save the branding changes, select Done.
Table and column layouts for panels in Document of Record table-and-column-layouts-for-panels-in-document-of-record
Your Adaptive Form may be a lengthy one with several form fields. You may not want to save a Document of Record as an exact copy of the Adaptive Form. Now you can choose a table or column layout for saving one or more Adaptive Form panels in the Document of Record PDF.
Before generating a Document of Record, in a panel’s settings, select Layout For The Document of Record for that panel as Table or Column. The fields in the panel get organized accordingly in the Document of Record.
Fields in a panel rendered in a table layout in the Document of Record
Fields in a panel rendered in a column layout in the Document of Record
Document of Record settings document-of-record-settings
Document of Record settings let you choose options you want to include in the Document of Record. For example, a bank accepts name, age, social security number, and phone number in a form. The form generates a bank account number, and branch details. You can choose to display only the name, social security number, bank account, and branch details in Document of Record.
Setting of the Document of Record component are available under its properties. To access the properties a component, select the component and click in the overlay. The properties are listed in the sidebar, and you can find the following settings in it.
Field level settings
-
Exclude From Document of Record: Setting the property true excludes the field from Document of Record. This is script-able property named
excludeFromDoR
. Its behavior depends on Exclude fields from DoR if hidden form level property. -
Display panel as table: Setting the property displays panel as table in Document of Record if panel has less than 6 fields in it. Applicable for panel only.
-
Exclude title from Document of Record: Setting the property excludes title of the panel/table from Document of Record. Applicable for panel and table only.
-
Exclude description from Document of Record: Setting the property excludes description of the panel/table from Document of Record. Applicable for panel and table only.
Form level settings
- Include unbound fields in DoR: Setting the property includes unbound fields from Schema based Adaptive Form in Document of Record. By default it is true.
See Also see-also
- Create an AEM Adaptive Form
- Add an AEM Adaptive Form to the AEM Sites page
- Apply themes to an AEM Adaptive Form
- Add components to an AEM Adaptive Form
- Use CAPTCHA in an AEM Adaptive Form
- Generate a PDF version (DoR) of an AEM Adaptive Form
- Translate an AEM Adaptive Form
- Enable Adobe Analytics for an Adaptive Form to track form usage
- Connect Adaptive Form to Microsoft SharePoint
- Connect Adaptive Form to Microsoft Power Automate
- Connect Adaptive Form to Microsoft OneDrive
- Connect Adaptive Form to Microsoft Azure Blob Storage
- Connect Adaptive Form to Salesforce
- Use Adobe Sign in an AEM Adaptive Form
- Add a new locale for an Adaptive Form
- Send Adaptive Form data to a database
- Send Adaptive Form data to a REST endpoint
- Send Adaptive Form data to AEM Workflow
- Use Forms Portal to list AEM Adaptive Forms on an AEM website
- Add versionings, comments, and annotations to an Adaptive Form
- Compare Adaptive Forms