Generate Document of Record for adaptive forms or adaptive form fragments generate-document-of-record-for-adaptive-forms

Adobe recommends using the modern and extensible data capture Core Componentsfor creating new Adaptive Formsor adding Adaptive Forms to AEM Sites pages. These components represent a significant advancement in Adaptive Forms creation, ensuring impressive user experiences. This article describes older approach to author Adaptive Forms using foundation components.

Version
Article link
AEM as a Cloud Service
Click here
AEM 6.5
This article

Overview overview

After submitting a form, your customers generally want to keep a record, in print or in document format, of the information they have filled in the form for their future reference. This is referred to as a document of record.

This article explains how you can generate a document of record for Adaptive Forms or Adaptive Form fragment.

NOTE
The support to customize your Adaptive Form fragments and its fields in Adaptive Form editor was introduced with AEM 6.5 Forms Service Pack 19 (6.5.19.0).
NOTE
Auto-generation of document of record is not supported for XFA-based adaptive forms. However, you can use the XDP used to create the adaptive form as document of record.

Adaptive form types and their documents of record adaptive-form-types-and-their-documents-of-record

When you create an adaptive form, you can select a form model. Your options are:

  • Form Templates
    Lets you select an XFA template for your adaptive form. When you select an XFA template, you can use the associated XDP file for document of record as described above.

  • XML Schema
    Lets you select an XML schema definition for your adaptive form. When you select an XML schema for your adaptive form, you can:

    • Associate an XFA template for document of record. Ensure that associated XFA template uses the same XML schema as your adaptive form
    • Automatically generate document of record
  • None
    Lets you create an adaptive form without a form model. The document of record is automatically generated for your adaptive form.

When you select a form model, configure document of record using options available under Document of Record Template Configuration. See Document of Record Template Configuration.

Automatically generated document of record automatically-generated-document-of-record

A document of record lets your customers keep a copy of submitted form for printing purpose. When you automatically generate a document of record, everytime you change your form, its document of record is updated immediately. For example, you remove age field for customers who select United States of America as their country. When such customers generate a document of record, the age field is not visible to them in the document of record.

Automatically generated document of record has the following advantages:

  • It takes care of data binding.
  • It automatically hides fields which are marked exclude from document of record at the time of submission. No extra effort is required.
  • It saves time for designing document of record template.
  • It lets you try different styling and appearance using different base templates and choose best style and appearance for Document of Record. Styling appearances are optional, and if you do not specify styling, system styles are set as default.
  • It ensures any change in form is immediately reflected in document of record.

Components to automatically generate a document of record components-to-automatically-generate-a-document-of-record

To generate a document of record for adaptive forms, you need the following components:

Adaptive form Adaptive form for which you want to generate a document of record.

Adaptive form fragment Adaptive form fragment for which you want to generate a document of record.

Base template (recommended) XFA template (XDP file) created in AEM Designer. Base template is used to specify styling and branding information for document of record template.

See Base template of a document of record

NOTE
Base template of a document of record is also called meta-template of a document of record.

Document of record template XFA template (XDP file) generated from an adaptive form.

See Document of Record Template Configuration.

Form data Information filled in by a user in the adaptive form. It merges with the document of record template to generate the document of record.

Mapping of adaptive form elements mapping-of-adaptive-form-elements

The following sections describe how adaptive form elements appear in document of record.

Fields fields

Adaptive form component
Corresponding XFA component
Included by default in document of record Template?
Notes
Button
Button
false
Check box
Check Box
true
Date picker
Date/Time Field
true
Drop-down list
Drop-down List
true
Scribble Signature
Signature Scribble
true
Numeric box
Numeric Field
true
Password box
Password Field
false
Radio Button
Radio Button
true
Text box
Text Field
true
Reset button
Reset Button
false
Submit button

Email Submit Button

HTTP Submit Button

false
Terms and conditions
true
File Attachment
false
Not available in document of record template. Only Available in document of record through attachments.

Containers containers

Adaptive form component
Corresponding XFA component
Notes
Panel
Subform
Repeatable panel maps to repeatable subform.

Static components static-components

Adaptive form component
Corresponding XFA component
Notes
Image
Image
The TextDraw and Image components, whether bound or unbound, always appear in the document of record for an XSD-based adaptive form, unless excluded using the document of record settings.
Text
Text
NOTE
In classic UI, you get different tabs for editing field properties.

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 want to add your company logo in the header, and copyright information in the footer of the document of record. The master page from base template is used as a master page for document of record template. The master page can have information such as page header, page footer, and page number that you can apply to document of record. You can apply such information to document of record using base template for auto generation of document of record. Using base template enables you to change default properties of fields.

Be sure you follow Base template conventions when you design base template.

Base template conventions base-template-conventions

A base template is used to define header, footer, styling, and appearance for 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 header, footer, page number, or any other information that should appear across all pages in the document of record. If you are using a base template which does not conform to base template conventions, the first master page from the base template is still used in 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, you should name the root subform as AF_METATEMPLATE and the master page as AF_MASTERPAGE.

  • The master page with the name AF_MASTERPAGE located under the AF_METATEMPLATE root subform is given preference 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 in the AF_FIELDSSUBFORM subfrom under the AF_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 be AF_CHECKBOX_XFO.

To create a base template, do the following in AEM Designer.

  1. Click File > New.

  2. Select the Based on a template option.

  3. Select the Forms - Document of Record category.

  4. Select DoR Base Template.

  5. Click Next and provide the required information.

  6. (Optional) Modify the styling and appearance of fields that you want to apply on the fields in the document of record.

  7. Save the form.

You can now use the saved form as a base template for document of record.
Do not modify or remove any scripts present in the base template.

Modifying base template

  • If you are not applying any styling over fields in base template, it is advisable to remove those fields from base template so any upgrades to base template are automatically picked up.
  • While modifying base template, do not remove, add, or modify scripts.
NOTE
Design base template using conventions and strictly following the steps above.

Document of Record Template Configuration document-of-record-template-configuration

Configure the document of record template of your form to let your customers download a print friendly copy of the submitted form. An XDP file serves as the document of record template. The document of record customers download is formatted according to the layout specified in the XDP file.

Perform the following steps to configure a document of record for adaptive forms:

  1. In AEM author instance, click Forms > Forms and Documents.

  2. Select a form, and click View Properties.

  3. In the Properties window, select Form Model.
    You can also select a form model when you create a form.

    note note
    NOTE
    In the Form Model tab, ensure that you select Schema or None from the Select From drop-down. Document of record is not supported for XFA-based or adaptive forms with Form Template as form model.
  4. In the Document of Record Template Configuration section of the Form Model tab, select one of the following options:

    None Select this option if you do not want to configure document of record for the form.

    Associate Form Template as Document of Record Template Select this option if you have an XDP file that you want to use as a template for the document of record. On selecting this option, all XDP files available in AEM Forms repository are displayed. Select the appropriate file.

    The selected XDP file gets associated with the adaptive form.

    Generate Document of Record Select this option to use an XDP file as a base template for defining the styling and appearance for the document of record. On selecting this option, all XDP files available in AEM Forms repository are displayed. Select the appropriate file.

    note note
    NOTE
    Ensure that schema used to create adaptive form and schema (data schema) of XFA Form are same if:
    code language-none
    * Your Adaptive form is schema based
    * You are using **Associate Form Template as the Document of Record Template** option for document of record
    
  5. Click Done.

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, you need to ensure the locale of the browser is set appropriately. To customize the branding information of document of record, complete the following steps:

  1. Select a panel (root panel) in the document of record and then select configure .

  2. Select dortab . The Document of Record tab appears.

  3. 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.

    brandingtemplate

    If you choose to select a custom template, browse a select an XDP on your AEM Forms server. If you want to use a template that is not already on your AEM Forms server, you need to first upload the XDP to your AEM Forms server.

  4. Based on whether you select a default or a custom template, some or all the following properties appear in the Document Of Record tab. Specify these appropriately:

    • 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
    • Header Text
    • Disclaimer Label
    • Disclaimer
    • Disclaimer Text
    • Accent Color: The color in which header text and separator lines are rendered in the document or record PDF
    • Font Family: Font family of the text in the document of record PDF
    • For Check Box and Radio Button components, show only the selected values
    • Separator for multiple selected value(s)
    • Include form objects that are not bound to data model
    • Exclude hidden fields from the document of record
    • Hide description of panels

    If the custom XDP template that you select includes multiple master pages, the properties for those pages appear in the content section of the Document of Record tab.

    Master Page Properties

    The master page properties include Logo Image, Header Text, Form Title, Disclaimer Label, and Disclaimer Text. You can apply adaptive form or XDP template properties to the Document of Record. AEM Forms applies the template properties to the Document of Record by default. You can also define custom values for the master page properties. For information on how to apply multiple master pages in a Document of Record, see Apply multiple master pages to a Document of Record.

    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>
    
  5. 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 table layout in the document of record

Fields in a panel rendered in a column 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.

The document of record settings of a component are available under its properties. To access the properties a component, select the component and click cmppr 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.

  • Pagination > Place: Determines where you select to place the panel.

    • Place > Following Previous: Places the panel after the previous object in the parent panel.
    • Place > In Content Area > Name of content area: Places the panel in the specified content area.
    • Place > Top of Next Content Area: Places the panel at the top of the next content area.
    • Place > Top of Content Area > Name of content area: Places the panel at the top of the specified content area.
    • Place > On Page > Name of master page: Places the panel on the specified page. If a page break is not inserted automatically, AEM Forms adds a page break.
    • Place > Top of Next Page: Places the panel at the top of the next page. If a page break is not inserted automatically, AEM Forms adds a page break.
    • Place > Top of Page > Name of master page: Places the panel at the top of the page, when the specified page is rendered. If a page break is not inserted automatically, AEM Forms adds a page break.
  • Pagination > After: Determines which area to fill after a panel is placed.The following fields are available in the After section:

    • After > Continue Filling Parent: Continues merging data for all objects remaining to be filled in the parent panel.
    • After > Go to Next Content Area: Starts filling the next content area after placing the panel.
    • After > Go To Content Area > Name of content area: Starts filling the specified content area after placing the panel.
    • After > Go To Next Page: Starts filling the next page after placing the panel.
    • After > Go To Page > Name of page: Starts filling the specified page after placing the panel.
  • Pagination > Overflow: Sets an overflow for a panel or a table that spans pages. The following fields are available in the Overflow section:

    • Overflow > None: Starts filling the next page. If a page break is not inserted automatically, AEM Forms adds a page break.
    • Overflow > Go to Content Area > Name of content area: Starts filling the specified content area.
    • Overflow > Go To Page > Name of page: Starts filling the specified page.
    note note
    NOTE
    Pagination property is not available for adaptive form fragments.

For information on how to apply page breaks and apply multiple master pages in a Document of Record, see Apply page break in a Document of Record and Apply multiple master pages to a Document of Record.

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.
  • Exclude fields from DoR if hidden: Set the property to exclude the hidden fields from Document of Record at form submission. When you enable Revalidate on server, the server recomputes the hidden fields before excluding those fields from the Document of Record.

Apply a page break in a Document of Record apply-page-breaks-in-dor

You can apply page breaks in a Document of Record using multiple methods.

To apply a page break to a Document of Record:

  1. Select the panel and select Configure

  2. Expand Document of Record to view the properties.

  3. In the Pagination section, select Folder in the Place field.

  4. Select Top of Next page and select Select. You can also select Top of Page, select the master page, and select Select to apply the page break.

  5. Select Save to save the properties.

The selected panel moves to the next page.

Apply multiple master pages to a Document of Record apply-multiple-master-pages-dor

If the custom XDP template that you select includes multiple master pages, the properties for those pages appear in the content section of the Document of Record tab. For more information, see Customize the branding information in document of record.

You can apply multiple master pages to a Document of Record by applying different master pages to the components of an adaptive form. Use the Pagination section of the Document of Record properties to apply multiple master pages.

The following is an example of how to apply multiple master pages to a Document of Record:
You upload an XDP template that includes four master pages to the AEM Forms server. AEM Forms applies the template properties to the Document of Record by default. AEM Forms also applies the first master page properties in the template to the Document of Record.

To apply the second master page properties to a panel and the third master page properties to the panels that follow, execute the following steps:

  1. Select the panel to apply the second master page and select Configure .
  2. In the Pagination section, select Folder in the Place field.
  3. Select On page, select the second master page and select Select.
    AEM Forms applies second master page to the panel and all subsequent panels in the adaptive form.
  4. In the Pagination section, select Folder in the After field.
  5. Select Go To page, select the third master page and select Select.
  6. Select Save to save the properties.
    AEM Forms applies third master page to the panel and all subsequent panels in the adaptive form.
NOTE
You cannot apply multiple master pages to a Document of Record for an adaptive form Fragment.

Key considerations when working with document of record key-considerations-when-working-with-document-of-record

Keep in mind the following considerations and limitations when working on 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 end 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 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. For more information on localization of document of record and adaptive forms see Using AEM translation workflow to localize adaptive forms and document of record.

Use a custom XCI file

An XCI file helps you set various properties of a document. You can use a custom XCI file to override one or more default properties specified in the your existing XCI file. For example, you can choose to embed a font into a document or enable tagged property for all the documents. The following table specifies the XCI options:

XCI option
Description
config/present/pdf/creator
Identifies the document creator using the Creator entry in the Document Information dictionary. For information about this dictionary, see the PDF Reference guide.
config/present/pdf/producer
Identifies the document producer using the Producer entry in the Document Information dictionary. For information about this dictionary, see the PDF Reference guide.
config/present/layout
Controls whether the output is a single panel or paginated.
config/present/pdf/compression/level
Specifies the degree of compression to use when generating a PDF document.
config/present/pdf/fontInfo/embed
Controls font embedding in the output document.
config/present/pdf/scriptModel
Controls whether XFA-specific information is included in the output PDF document.
config/present/common/data/adjustData
Controls whether the XFA application adjusts the data after merging.
config/present/pdf/renderPolicy
Controls whether the generation of page content is done on the server or deferred to the client.
config/present/common/locale
Specifies the default locale used in the output document.
config/present/destination
When contained by a present element, specifies the output format. When contained by an openAction element, specifies the action to perform upon opening the document in an interactive client.
config/present/output/type
Specifies either the type of compression to apply to a file or the type of output to produce.
config/present/common/temp/uri
Specifies the Form URI.
config/present/common/template/base
Supplies a base location for URIs in the form design. When this element is absent or empty, the location of the form design is used as the base.
config/present/common/log/to
Controls the location that log data or output data is written to.
config/present/output/to
Controls the location that log data or output data is written to.
config/present/script/currentPage
Specifies the initial page when the document is opened.
config/present/script/exclude
Informs Forms as a Cloud Service which events to ignore.
config/present/pdf/linearized
Controls whether the output PDF document is linearized.
config/present/script/runScripts
Controls which set of scripts Forms as a Cloud Service executes.
config/present/pdf/tagged
Controls the inclusion of tags into the output PDF document. Tags, in the context of PDF, are additional information included in a document to expose the logical structure of the document. Tags assist accessibility aids and reformatting. For example, a page number may be tagged as an artifact so that a screen reader does not enunciate it in the middle of the text. Although tags make a document more useful, they also increase the size of the document and the processing time to create it.
config/present/pdf/fontInfo/alwaysEmbed
Specifies a font that is embedded into the output document.
config/present/pdf/fontInfo/neverEmbed
Specifies a font that must never be embedded into the output document.
config/present/pdf/pdfa/part
Specifies the version number of the PDF/A specification that the document conforms to.
config/present/pdf/pdfa/amd
Specifies the amendment level of the PDF/A specification.
config/present/pdf/pdfa/conformance
Specifies the conformance level with the PDF/A specification.
config/present/pdf/version
Specifies the version of PDF document to generate
config/present/pdf/version/map
Specifies the fall back fonts for the document

Use a custom XCI file in your local Forms development environment

  1. Upload the XCI file to your local development environment.
  2. Open configuration manager.
  3. Locate and open the Adaptive Forms and Interactive Communication Web Channel configuration.
  4. Specify path of the XCI file and click Save.
recommendation-more-help
19ffd973-7af2-44d0-84b5-d547b0dffee2