Open an encrypted MDX form with LoadEncryptedForm and its key, then export the decrypted template to PDF.

Opening the protected template. The encrypted MDX file is loaded with its key, after which the form can be handled like any other definition.

Decryption and export. The entry point in Loading an Encrypted Form/Program.cs opens the protected file and exports the decrypted form to PDF:
var form = new StiForm();
form.LoadEncryptedForm(@"Data\SoftwareEvaluationSurvey.mdx", "secterKey");

var exporter = new StiPdfExporter();
var pdf = exporter.ExportForm(form);

string path = "form.pdf";
File.WriteAllBytes(path, pdf);

Process.Start(new ProcessStartInfo(path) { UseShellExecute = true });

Keeping the key separate. In a production application, the decryption key should come from protected configuration rather than being stored beside the template.

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.