<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alastair Malkin on Medium]]></title>
        <description><![CDATA[Stories by Alastair Malkin on Medium]]></description>
        <link>https://medium.com/@malkin.adobe?source=rss-da115b7b63e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*o03OqNVjsMTgWayNVH4Wbg.jpeg</url>
            <title>Stories by Alastair Malkin on Medium</title>
            <link>https://medium.com/@malkin.adobe?source=rss-da115b7b63e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 22:16:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@malkin.adobe/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The AEM Forms and Adobe Sign Integration: Creating a Dynamic Contract]]></title>
            <link>https://medium.com/adobetech/an-integration-with-aem-forms-and-adobe-sign-to-create-a-dynamic-contract-ca05bb8b80fb?source=rss-da115b7b63e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca05bb8b80fb</guid>
            <category><![CDATA[adobe-sign]]></category>
            <category><![CDATA[aem-forms]]></category>
            <category><![CDATA[pega]]></category>
            <dc:creator><![CDATA[Alastair Malkin]]></dc:creator>
            <pubDate>Mon, 23 Mar 2020 15:06:02 GMT</pubDate>
            <atom:updated>2020-04-02T09:26:32.458Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W_Xoqjw-m5ihTQAkKNOzIQ.png" /></figure><p>It is always fun when you have the chance to look at something you know in theory or have touched upon in the past, and go deeper and create something real. This is what has happened to us recently as we looked at how best to showcase AEM Forms’ dynamic capabilities by integrating with <a href="https://www.pega.com/">Pega</a> to create a contract that can be then sent to Adobe Sign.</p><p>We had the chance to build an integration between Pega and AEM to generate a PDF dynamically based upon a payload sent to AEM. AEM would contain multiple Templates, and the payload would determine which ones to use to create a single merged PDF. The merged PDF would then contain the data specified in the payload, as well as adding additional information like the logo, footer and page numbering. Finally, a Signature Block would be included in the merged PDF. Here’s how it all works.</p><h3><strong>Overview</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*nPnhLOV06pB3Kve4NdKn9A.png" /></figure><h4>Flow</h4><ol><li>Pega sends the documents that need to be attached in the final merged PDF. This could be the AEM DAM or other storage location.</li><li>Pega calls the CreateContract Servlet running on AEM with a payload in JSON format describing the contents of the merged PDF.</li><li>The CreateContract Servlet retrieves the XDP Templates listed in the JSON payload.</li><li>The <a href="https://docs.adobe.com/content/help/en/experience-manager-65/forms/use-document-services/output-service.html">Output Service</a> will use the JSON payload details and the XDP file to merge the data, create a TOC, add a Watermark if required and include the documents sent in step 1 as attachments.</li><li>Using the <a href="https://docs.adobe.com/content/help/en/experience-manager-65/forms/use-document-services/assembler-service.html">Assembly Service</a>, the final merged PDF is created and stored, again this could in the AEM DAM or other storage location.</li><li>A response is sent back to PEGA containing the path to the merged PDF.</li></ol><p>Now that Pega has the created PDF, it can now send it to Adobe Sign for signing. This step could also be achieved from AEM, but in this case the client wanted to send it from Pega.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*2pb_E9DgVitXdERlCdqAAg.png" /></figure><p>To do this, a webapp was created in Pega to manage the flow:</p><ol><li>The response from the first step is the path to the merged PDF.</li><li>In Pega, a Contract Creation webapp sends the path to the merged PDF to Adobe Sign and the email address of the respondent.</li><li>Adobe Sign creates an Agreement to send to the respondent and sends the contract to sign.</li><li>Adobe Sign returns an AgreementId to Pega.</li><li>A Webhook connection has been created in Adobe Sign pointing to a Webhook in Pega.</li><li>Once the contract has been signed, the Webhook sends a message to Pega.</li><li>Pega can now retrieve the signed document, to be signed in their own infrastructure.</li></ol><h3>Installation</h3><p>To achieve this flow, I will focus on what was needed from Adobe. The Pega integration and setup is a separate installation. Also, AEM Forms running on 6.5 works best on Windows.</p><p>The Adobe solutions:</p><ul><li>AEM 6.5</li><li>AEM Forms Package</li><li>Forms Designer (Windows only to create the XDP Templates/Fragments)</li><li>Adobe Sign Developer Account</li></ul><h3>AEM Forms</h3><p>Much of the installation and configuration is detailed in the <a href="https://docs.adobe.com/content/help/en/experience-manager-65/forms/home.html">Forms User Guide</a> but to demonstrate this flow I will only highlight the main configuration required:</p><ul><li>Install AEM Forms Package</li><li>Add the Boot delegate RSA and BouncyCastle libraries as mentioned in <a href="https://helpx.adobe.com/aem-forms/6-3/installing-configuring-aem-forms-osgi.html">Installing AEM Forms</a></li></ul><p>That will be sufficient to recreate this flow.</p><h3><strong>The XDP templates</strong></h3><p>The approach we took was to create an XDP Template and an XML to map to. To create the XDP file you will need the Form Designer, and a Windows machine to run this. The Designer install file can be obtained in the email containing the link to AEM jar.</p><h4><strong>Step 1: New Template creation</strong></h4><ol><li>Create a New Form</li><li>Select a PDF of the Contract form</li><li>On the Import Options Select “Create an Interactive Form With a Flowable layout”</li></ol><h4><strong>Step 2: Creation of the Text fields</strong></h4><p>Here you go through the XDP document and place the text fields where you want the data to be merged from the JSON payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*kynMg1hwoZqxh8BPQLBPPQ.png" /><figcaption>An example of the XDP document in the Designer.</figcaption></figure><h3><strong>The JSON payload</strong></h3><p>This was relatively complicated when it came to providing a level of flexibility to the customer. The example demonstrates the type of data sent to AEM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*bzauIVHnZTPRHbcDm_MnvA.png" /><figcaption>Example of the JSON payload</figcaption></figure><h3>AEM</h3><p>With AEM Forms installed, you can now start the process of building the tools to create the merged PDF in AEM:</p><ol><li>Create a Servlet that Pega can use to send the payload of JSON to define the PDF</li><li>Load the XDP Templates under “/content/dam/formsanddocuments”</li><li>Load the XML files of the structure expected by the XDP Templates</li></ol><h4><strong>XML Files</strong></h4><p>We used real XML files in AEM to make the process easier, but this could done dynamically in code.</p><h4><strong>CreateContract Servlet</strong></h4><p>The central component of the whole flow. Pega will call this endpoint and pass the JSON payload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*MmkBiceEzvXKp_Ij0T_t2g.png" /><figcaption>Basic flow of the Servlet</figcaption></figure><p>If the request payload specified a DOC type and then only DOC file would be created. This generation was done with <a href="https://poi.apache.org/">Apache POI</a>, and there is a OSGI wrapper available for this process.</p><p>To generate the PDF we created string of XML in the DDX format, expected by the Document Services. Here we can include details about the final document title, the Watermark details, TOC, the merged PDFs and the attachments.</p><h3>In conclusion</h3><p>This approach is entirely configurable and does provide a level of flexibility to to integrate with AEM Forms and Adobe Sign to create a powerful way to create dynamic PDFs. The next steps are to provide security to the connection with AEM and streamline the process, including creating Template versions and storage. The vision is to create a tool that is robust and flexible enough to manage multiple users, documents and templates for the foreseeable future.</p><h3>Contributes</h3><p><a href="https://medium.com/u/fd41826f0822">Prateek Tewari</a> and <a href="https://medium.com/u/2823047a5c93">Pawan Mittal</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca05bb8b80fb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adobetech/an-integration-with-aem-forms-and-adobe-sign-to-create-a-dynamic-contract-ca05bb8b80fb">The AEM Forms and Adobe Sign Integration: Creating a Dynamic Contract</a> was originally published in <a href="https://medium.com/adobetech">Adobe Tech Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>