Creation of Custom Electronic Signature Boxes
This article describes the customization of electronic signature boxes. It contains further explanations including the creation of templates and shows all code snippets required. The step-by-step guide brings all parts together - from template design to the creation and implementation of the class for custom settings.

Template Creation
Consider a contract that should be signed electronically where you would like to pass additional data along with the signature.
This is just an example. You can store much more depending on your personal or business requirements. The signature box must be a TextFrame object with a name. Along with the image placeholder for the electronic signature, you can add static content, merge fields or barcodes. The elements will be merged with the associated data.
Custom Data Definition
A class called SignatureData.cs is defined in the Models section of your project. The class contains getter and setter for the custom data. A typical class could look like this:
public class SignatureData
{
public string Barcode { get; set; }
public string Signer { get; set; }
public string IPAddress { get; set; }
}
Connecting the Dots
After you created the template and class to pass your data, you can set the values in the controller. In order to do so, create a new instance of SignatureData class in the controller. They will be used to merge the custom signature box content. The code could look like this:
SignatureData data = new SignatureData()
{
Barcode = "https://www.textcontrol.com/",
IPAddress = "102.72.278.0",
Signer = "Tim Typer"
};
Lastly, create a CustomSignatureData object in the HTML helper of the view. Make sure to import the model in the view. Then, simply pass the properties of the model to the SignatureSettings:
@Html.TXTextControl().DocumentViewer(settings =>
{
settings.DocumentPath = Server.MapPath("~/App_Data/contract.tx");
settings.Dock = DocumentViewerSettings.DockStyle.Window;
settings.IsSelectionActivated = true;
settings.ShowThumbnailPane = true;
settings.SignatureSettings = new SignatureSettings()
{
OwnerName = "Paul Paulsen",
SignerName = Model.Signer,
ShowSignatureBar = true,
UniqueId = Guid.NewGuid().ToString(),
CustomSignatureData = new ElectronicSignatureDocumentViewer.Models.SignatureData()
{
Barcode = Model.Barcode,
Signer = Model.Signer,
IPAddress = Model.IPAddress
}
};
}).Render()
The following screenshot shows the resulting PDF document with the custom signature box.
Download Sample
You can test this on your own by downloading the sample from our GitHub repository.
Download and Fork This Sample on GitHub
We proudly host our sample code on github.com/TextControl.
Please fork and contribute.
Requirements for this sample
- Visual Studio 2019
- TX Text Control .NET Server X19
Angular
Integrate document processing, editing, sharing, collaboration, creation, electronic signatures, and PDF generation into your Angular Web applications.
Related Posts
AngularASP.NETDocument Processing
Don't Print Your Documents! Streamlined Document Processes in Your Applications
In modern, collaborative environments, document review and approval processes can be streamlined by supporting the process with the right technology that helps to accelerate the workflows.
Document Viewer: Uploading Signatures
The document viewer that is part of TX Text Control .NET Server provides a feature to deploy forms and documents to collect electronic signatures from users. This article shows how signature…
Electronic Signatures: Document Audit Trails
In order to implement a legally binding document signing process, a complete document audit trail must be recorded to verify every action taken on a document. This article shows how the eSign demo…
Combine Form Fields, Merge Fields and Signature Boxes to Request Signatures
The eSign Demo shows how to use TX Text Control to implement electronic signatures into your applications. This article shows how to combine form fields, merge fields and signature boxes to…
eSign Demo: Requesting Signatures from Multiple Signers
We just published an enhanced version of our electronic signature demo that supports the request of signatures from multiple signers. This article gives an overview of the new features.