Loading a Form from String
Our sample projects and report templates can help you learn the basics of working with our products.Reconstruct a form from its serialized string, export it to PDF, and open the generated document.
Restoring the definition. A serialized MRT definition can come from a database, an API, or another application layer without first being written to disk.
Using the serialized value. The console code in
Restoring the definition. A serialized MRT definition can come from a database, an API, or another application layer without first being written to disk.
Using the serialized value. The console code in
Loading a Form from String/Program.cs passes the string to StiForm and continues with an ordinary PDF export:// formStr holds the serialized MRT definition (from a database, an API, or another layer)
var form = new StiForm();
form.LoadFromString(formStr);
var exporter = new StiPdfExporter();
var pdf = exporter.ExportForm(form);
string path = "form.pdf";
File.WriteAllBytes(path, pdf);
Process.Start(new ProcessStartInfo(path) { UseShellExecute = true });