The TX Text Control SignatureField TX Text Control .NET Server for ASP.NET
TXTextControl Namespace
SignatureField Class
An instance of the SignatureField class represents a signature field in a Text Control document.
objects are compatible to the Signature Line element in MS Word. This article shows how to insert those elements in MS Word in order to import and process these objects in TX Text Control.

Creating Signature Lines in MS Word

To create a document in MS Word that contains a signature line, use the Signature Line button in the Text ribbon group of the Insert ribbon tab.

Signature Line in MS Word

In the opened dialog, additional information can be added to the signature line. These values are available in the SignatureField class when importing the document into TX Text Control.

Signature Line in MS Word

After clicking OK, the signature line is inserted into the document.

Signature Line in MS Word

Processing SignatureFields

After loading the document into TX Text Control, the signature lines are accessible through the SignatureFieldCollection TX Text Control .NET Server for ASP.NET
TXTextControl Namespace
SignatureFieldCollection Class
An instance of the SignatureFieldCollection class contains all signature fields in a Text Control document represented through objects of the type SignatureField.
.

using (TXTextControl.ServerTextControl tx = new ServerTextControl()) {
tx.Create();
tx.Load("test.docx", TXTextControl.StreamType.WordprocessingML);
foreach (SignatureField field in tx.SignatureFields) {
Debug.WriteLine(JsonConvert.SerializeObject(field));
}
}
view raw test.cs hosted with ❤ by GitHub

All signature properties have been imported:

{
"Image":null,
"SignerData":{
"Name":"Klaus Signer",
"Title":"Chief Signer",
"Address":"",
"ContactInfo":"signer@klaus.com",
"Reason":""
}
}
view raw test.json hosted with ❤ by GitHub

TX Text Control provides additional SignerData TX Text Control .NET Server for ASP.NET
TXTextControl Namespace
SignerData Class
An instance of the SignerData class represents the data of a suggested signer connected with a SignatureField.
properties to be compatible to the Adobe PDF format when signing PDF documents.

Property Description
Address Gets the address of a suggested signer.
ContactInfo Gets contact information of a suggested signer, such as a phone number.
Name Gets the name of a suggested signer.
Reason Gets a reason why the document is signed.
Title Gets the title of a suggested signer.

Signing SignatureFields

An X509Certificate2 certificate object is created from a PFX file that is then assigned to all signature fields. The list of signatures is provided through the SignatureFields TX Text Control .NET Server for ASP.NET
TXTextControl Namespace
SaveSettings Class
SignatureFields Property
Specifies an array of DigitalSignature objects, each of which defines an X.509 certificate and is associated with a SignatureField in the document.
property to the Save TX Text Control .NET Server for ASP.NET
TXTextControl Namespace
ServerTextControl Class
Save Method
Saves the complete contents of a document with the specified format.
method to export the signed document as an Adobe PDF document.

using (TXTextControl.ServerTextControl tx = new ServerTextControl()) {
tx.Create();
tx.Load("test.docx", TXTextControl.StreamType.WordprocessingML);
List<TXTextControl.DigitalSignature> digitalSignatures = new List<DigitalSignature>();
foreach (SignatureField field in tx.SignatureFields) {
digitalSignatures.Add(new DigitalSignature(
new System.Security.Cryptography.X509Certificates.X509Certificate2(
"textcontrolself.pfx", "123"), null, field.Name));
}
SaveSettings saveSettings = new SaveSettings() {
SignatureFields = digitalSignatures.ToArray()
};
tx.Save("results.pdf", TXTextControl.StreamType.AdobePDF, saveSettings);
}
view raw test.cs hosted with ❤ by GitHub