Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active September 5, 2022 13:46
Show Gist options
  • Save bjoerntx/1a3901ea1614c7945871cda7c1d7d6a5 to your computer and use it in GitHub Desktop.
Save bjoerntx/1a3901ea1614c7945871cda7c1d7d6a5 to your computer and use it in GitHub Desktop.
// get the SignatureField by Name
TXTextControl.SignatureField signatureField =
textControl1.SignatureFields.GetItem("txsign_1");
// set the image
signatureField.Image = new TXTextControl.SignatureImage("signature.svg", 1);
// create a new digital signature
X509Certificate2 cert = new X509Certificate2("mycert.pfx", "123");
TXTextControl.DigitalSignature signature =
new TXTextControl.DigitalSignature(cert, null, "txsign_1");
// add the signatures
TXTextControl.SaveSettings saveSettings = new TXTextControl.SaveSettings() {
SignatureFields = new TXTextControl.DigitalSignature[] { signature }
};
// export the document
textControl1.Save("results.pdf", TXTextControl.StreamType.AdobePDF, saveSettings);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment