Scenario: Creating system-driven correspondence

This scenario describes how to generate letters without using the Create Correspondence application.

API for letter generation

The Asset Compose building block exposes APIs (in the LetterRenderService) that enable you to generate a letter. These APIs enable you to use automated processes or create an application to render the letter without opening the Create Correspondence application.

Note: The rendered letters only have the pre-selected and mandatory content included in their target areas. Any fields or variables related to a user is rendered empty, and a warning message is logged.

Using the letter object

The following API renders a letter using a letter object:

public PDFResponseType renderLetter(Letter letter, String initialDataXML, boolean mergeDataOnServer, boolean useTestData, boolean renderInteractive);
Parameter details:
letter
This letter template must be the full letter object containing all necessary data and assignments.

initialDataXML
The XML data that is merged with the letter's layout. You can retrieve the XML data from a content provider.

This XML data is used to initialize the data dictionary used in the letter, if any. The XML is augmented with ICC Control Data to contain the relevant content for modules used in the letter. The augmented XML is merged with the letter's layout template to generate the final PDF.

mergeDataOnServer
Set this parameter s to TRUE to merge the relevant data into the letter.

useTestData
Specifies whether to use test data for rendering. Set to FALSE in a production system.

renderInteractive
Specifies whether to render an interactive or non-interactive (flat) PDF file.

The APIs return an object of type com.adobe.icc.render.obj.PDFResponseType, which can be used to extract the final rendered PDF content using PDFResponseType.getFile().getDocument().

API for portfolio generation

The Asset Composer building block exposes APIs that enable you to generate a portfolio via an automated process. Within the portfolio, the letter’s PDF is interactive.

Note: Instead of using the APIs, you could create a post-process that uses the Assembler service to generate a PDF Portfolio. To generate a portfolio, provide the letter’s final PDF and a set of other PDF documents that the process could retrieve from other sources.

Using the portfolio object

The following API renders a portfolio using a portfolio object:

public PDFResponseType renderPortfolio(Portfolio portfolio, String dataXML);

Parameter details:

Portfolio
This portfolio template must be the full portfolio object containing all necessary documents and data.

dataXML
The XML data that is merged with the letter’s layout if the letter is used as a document in the portfolio. The data can be the XML data retrieved from a content provider.

This XML data is used to initialize the data dictionary used in the letter, if any. The XML is augmented with ICC Control Data to contain the relevant content for modules used in the letter. The augmented XML is merged with the letter's layout template to generate the final PDF.

The APIs return an object of type com.adobe.icc.render.obj.PDFResponseType, which can be used to extract the final rendered PDF content using PDFResponseType.getFile().getDocument().

// Ethnio survey code removed