Created
December 19, 2023 15:01
-
-
Save bjoerntx/5e5d5d80c3ab9d51dd49e70ec6ef4404 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var signerData = new SignerData( | |
"John Doe", "Signer", "676 Sign Street", "john@signer.com", "I approve this document"); | |
var signatureStyle = new SignatureStyle { | |
SvgImage = System.IO.File.ReadAllText("signature.svg"), | |
DetailsFont = new Font("Arial", 13)}; | |
// Add a signature box to the document | |
var fieldName = SignatureBoxManager.AddSignatureBox( | |
textControl1, | |
new Size(8000, 2000), | |
1, | |
SignatureLocation.BottomLeft, | |
signerData, | |
signatureStyle | |
); | |
// Create a digital signature using a certificate | |
var certificate = new X509Certificate2("textcontrolself.pfx", "123"); | |
var signatureFields = new List<DigitalSignature> { new DigitalSignature(certificate, null, fieldName) }; | |
var saveSettings = new TXTextControl.SaveSettings | |
{ | |
SignatureFields = signatureFields.ToArray() | |
}; | |
// Save the document as PDF/A | |
textControl1.Save("signed.pdf", TXTextControl.StreamType.AdobePDFA, saveSettings); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment