In addition to the standard Document Viewer signing process, which merges the signature image and returns the document, custom Web API calls can be used to handle custom requests. The RedirectUrlAfterSignature property can be used to provide an endpoint that is used to forward the signature data and the signed document.

The following MVC Razor code shows how to set the RedirectUrlAfterSignature property to pass the signature data to the HandleSignature controller method.

Loading...

Custom Signing Process

After the user signs the document, the electronic signature is attached to the document and forwarded to the specified URL, along with the signature data such as the signature image and timestamp information.

Custom Signature Process

To handle the signature data, a custom HttpPost method must be implemented.

Loading...

SignatureData Object

The Document Viewer calls this endpoint and passes an object of type SignatureData in the payload.

Custom Signature Process

This SignatureData object can be used to process the signed document in a custom process without sending the document back from the client side for further processing.

Signing Signature Fields

The following HttpPost method loads the signed document and applies a certificate to all signature fields by looping through the SignatureBoxes TX Text Control .NET Server for ASP.NET
Web.MVC.DocumentViewer Namespace
SignatureBox Class
The SignatureBox class represents the shown signature box in the UI.
.

Loading...

The result of this implementation is that all signature fields are digitally signed. The signature field image is the default image created by the Document Viewer.

Creating documents with TX Text Control

Flatten Form Fields

If the document contains form fields, you may want to flatten the form fields and convert the selected values to text in the final PDF document. Before exporting to PDF using the Save method, the following helper function can be called in the above code.

Loading...

Custom Signature Stamps

The following code uses the signature image captured by the Document Viewer. It uses this image only as the signature stamp.

Loading...

All of the signature fields will be merged with the captured signature image only, without the default signature stamp.

Creating documents with TX Text Control

From our GitHub repository, you can download the sample project that contains the controller methods for your own tests.