Recently, we released a new version of the DocumentViewer that supports custom signature handling by routing the signature data and/or signed document to a given, custom endpoint in your ASP.NET web application.
This is useful, if the signed document is stored server-side or needs to be further processed in your application. The sample project discussed in this article forwards the signed document and the associated data to a given URL. The following sequence diagram shows this workflow:
Learn more about all supported workflows in this detailed article about the new functionality:
Define the Redirect URL
The following HTML helper code shows how to add the DocumentViewer to the view and to set the RedirectUrlAfterSignature to the custom Home/HandleSignature controller in the same application.
Additionally, a query string parameter is given to show that additional, custom data can be forwarded to the request. In this sample, a simple securityToken string is forwarded to "validate" the request. In a real-world application, this could be any other data or a valid OAuth access token.
The custom controller HttpPost method HandleSignature is called by the DocumentViewer after a document has been signed successfully:
The forwarded SignatureData object contains meta data about the signature and the signed document:
On client-side, the setSubmitCallback method is used to attach a method that is called after a successful roundtrip to your custom controller method:
As the return value is always a string, it can be parsed into an object and directly accessed.
Test this on your own and download the sample application from our GitHub account.