Last active
October 22, 2020 10:13
-
-
Save bjoerntx/1791991604fcd61a92e3b4f84aa3769d 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
string sCDAData = System.IO.File.ReadAllText("004bb033-b948-4f4c-b5bf-a8dbd7d8dd40.xml"); | |
TXTextControl.EmbeddedFile cdaAttachment = | |
new TXTextControl.EmbeddedFile( | |
"004bb033-b948-4f4c-b5bf-a8dbd7d8dd40.xml", | |
sCDAData, | |
null) { | |
Description = "CDA2 information", | |
Relationship = "Unspecified" | |
}; | |
// add the attachment | |
textControl1.DocumentSettings.EmbeddedFiles = | |
new TXTextControl.EmbeddedFile[] { cdaAttachment }; | |
X509Certificate2 cert = new X509Certificate2 | |
("textcontrolself.pfx"), | |
"yourpassword"); | |
// add the digital signature | |
TXTextControl.SaveSettings saveSettings = new TXTextControl.SaveSettings() | |
{ | |
DigitalSignature = new TXTextControl.DigitalSignature(cert, null) | |
}; | |
textControl1.Save("cover_letter.pdf", TXTextControl.StreamType.AdobePDFA, saveSettings); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment