Last active
September 16, 2022 13:55
-
-
Save bjoerntx/f5a510f571794d280e711989e9ac030a 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
public static void SignDocument() { | |
using (ServerTextControl tx = new ServerTextControl()) { | |
tx.Create(); | |
// add dummy text | |
tx.Text = "This is a signed document"; | |
SaveSettings saveSettings = new SaveSettings(); | |
// add digital signature to sign complete document | |
saveSettings.DigitalSignature = new DigitalSignature( | |
new System.Security.Cryptography.X509Certificates.X509Certificate2( | |
"textcontrolself.pfx", "123"), null); | |
// export to PDF | |
tx.Save("signed_documents.pdf", StreamType.AdobePDF, saveSettings); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment