Create and configure a PDF form in code, then pass it to the web component for display or editing.

Creating the form in memory. A form does not have to start as an MRT file. The API can create the page, place elements on it, and set their content entirely in application code.

The form builder. The controller method in Working with Forms from Code/Controllers/HomeController.cs assembles the definition that is passed to the web component:
public IActionResult Export()
        {
            var exporter = new StiPdfExporter();

            var pdfFileBytes = exporter.ExportForm(HomeController.Form);
            var pdfFileName = $"Forms\\Form_{DateTime.Now.ToString("yyyy-MM-dd_HH.mm.ss")}.pdf";
            System.IO.File.WriteAllBytes(pdfFileName, pdfFileBytes);

            ViewBag.FormMessage = $"The Form has been saved to a file '{pdfFileName}'";

            return View("Index");
        }
    }
}

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.