Load an embedded MRT form with LoadFromResource, export it to PDF, and open the generated document.

Resolving the embedded template. Instead of relying on an external file, the application reads the MRT definition from the assembly resource collection.

Loading and exporting it. The sequence in Loading a Form from Resource/Program.cs identifies the resource, loads it into StiForm, and produces the PDF:
var form = new StiForm();
form.LoadFromResource(
    Type.GetType("Loading_a_Form_from_Resource.Program").Assembly,
    "Loading a Form from Resource.Data.SoftwareEvaluationSurvey.mrt");

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

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

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

Resource names. The namespace and embedded file name must match the manifest resource name generated by the project.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.