Loading an Encrypted Form
Our sample projects and report templates can help you learn the basics of working with our products.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
Keeping the key separate. In a production application, the decryption key should come from protected configuration rather than being stored beside the template.
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.