Display a Document Preview in the Interview

The Document Preview button in the interview toolbar links to an endpoint in your host application, allowing users to see a preview of an assembled document within the interview.

Document Preview Overview

To display a document preview the Document Preview Endpoint in your host application must:

  • Receive answers posted from the interview (i.e. the endpoint must accept the POST verb).
  • Assemble a new HTML document using Cloud Services.
  • Return the assembly result.

To display a Document Preview

1. Create a Document Preview endpoint in your host application

The answer data from the interview is sent to the Document Preview endpoint. The endpoint must retrieve the answers from the request form and use the answers to assemble a document. Use the following code (C#) to retrieve the answer data from the request form:

string[] hdInfoValues = Request.Form.GetValues("HDInfo");
string ansStr = "";
if (hdInfoValues != null && hdInfoValues.Length > 0)
{
     ansStr = string.Join(string.Empty, hdInfoValues);
}

2. Assemble the Document

You generate the content of the Document Preview by making an Assemble Document request to Cloud Services, using the same Template Package used to generate the interview. The request must use the HTML Assembly Format. The Assemble Document request returns an HTML string containing a preview of the completed document.

3. Return the Assembly Result

Return the HTML string generated by the Assemble Document request. The interview displays the document preview.

4. Configure Get Interview to use the Document Preview Endpoint

Set the DocPreviewUrl parameter for the Get Interview request to the URL for the Document Preview endpoint.