

Sequentially Sign Documents with Multiple Signers
source link: https://www.textcontrol.com/blog/2021/08/26/sequentially-sign-documents-with-multiple-signers/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

The Text Control DocumentViewer is designed to sign documents by multiple users. This article explains how to setup documents for multiple signers and gives an overview of the document deployment strategy.
Designing the Template
Using the DocumentEditor, you will need to add as many signature boxes to the document as required. In our sample, we create two different signature boxes for two different signers. A signature box is a TextFrame element that can be positioned anywhere in the document. In the following sample template, the text frames are inserted inline with text into table cells:
These two text frames receive unique names:
- txsign_signerA
- txsign_signerB
Technically, you can use any name for those signature boxes as you provide the name of the box to be signed when initializing the DocumentViewer. It is helpful to create your own logic to have a consistent naming.
Deploying the Document
The document should be stored in the internal Text Control format to keep all elements for the signature process. At the very end, the final document gets digitally signed and sealed. The following illustration shows the sequential signature process:
Sequential Signature Process
First, the document is deployed to signer A to be signed. The DocumentViewer is initialized with the signature box name txsign_signerA:
@Html.TXTextControl().DocumentViewer(settings => { settings.DocumentPath = "~/App_Data/Documents/template.tx"; settings.SignatureSettings = new SignatureSettings() { ShowSignatureBar = true, OwnerName = "Paul Paulsen", SignerName = "Signer A", SignerInitials = "AA", SignatureBoxName = "txsign_signerA", UniqueId = "123123123", }; }).Render()
In your JavaScript, a callback needs to be connected to the signing process using setSubmitCallback:
TXDocumentViewer.setSubmitCallback(saveSignedDocument);
function saveSignedDocument(e) {
var serviceURL = "@Url.Action("SaveSignedDocument", "TX")";
// send document to controller $.ajax({ type: "POST", url: serviceURL, data: { document: e.document }, success: successFunc, error: errorFunc }); function successFunc(data, status) { alert("Thanks"); }
function errorFunc(data, status) { console.log(data); } }
The DocumentViewer will send the signed document in the internal TX Text Control format to your callback. In our demo code, this document will be sent to a controller method SaveSignedDocument. This controller method should take the results of the signing process in order to send the signed document to the second signer.
After the second signature, the completely signed document will be sent back to the server to create the final PDF document. The following code takes the fully signed document in the internal TX Text Control format and creates a PDF/A with a digital signature:
[HttpPost] public string ExportPDF(string document) { byte[] bPDF;
// create temporary ServerTextControl using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) { tx.Create();
// load the document tx.Load(Convert.FromBase64String(document), TXTextControl.BinaryStreamType.InternalUnicodeFormat);
X509Certificate2 cert = new X509Certificate2( Server.MapPath("~/App_Data/textcontrolself.cer"));
TXTextControl.SaveSettings saveSettings = new TXTextControl.SaveSettings() { CreatorApplication = "TX Text Control Sample Application", DigitalSignature = new TXTextControl.DigitalSignature(cert, null) };
// save the document as PDF tx.Save(out bPDF, TXTextControl.BinaryStreamType.AdobePDFA, saveSettings); }
// return as Base64 encoded string return Convert.ToBase64String(bPDF); }
The final signed document contains both electronic signatures and is digitally signed and sealed:
Recommend
-
35
README.md Simple Interface Core Animation
-
99
Writing asynchronous JavaScript without using the Promise object is a lot like baking a cake with your eyes closed. It can be done, but it's gonna be
-
27
-
10
How do I design a system to process messages sequentially I have come across this problem at work and I want to know how it done/implemented generally. I don’t know where else to ask/discuss this. I would be really grateful if ther...
-
18
Blog Post Electronically Sign Documents with PSPDFKit Many companies are migrating to paperless workflows where customers, contractors, and visitors sign documents electronically rather than with pen and pa...
-
3
Requesting Signatures from Multiple Signers The integration of a digital document processing solution with electronic signature processes help companies to serve their customers and support business continuity. To showcase typical workfl...
-
7
V2EX › 数据库 为什么 Redlock 算法说“It tries to acquire the lock in all the N instances sequentially”
-
7
AutosignSign PDF documents online automatically
-
6
Early Access Program News CLion 2022.1 EAP5: Setting to Reload CMake Profiles Sequentially, Fi...
-
8
retrieve data sequentially from the R Web page advertisements I have done an advanced search in a web and get s...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK