Stimulsoft PDF Forms provides an Angular component for editing and filling forms in the browser, backed by a single ASP.NET Core action.

Handle form requests in the controller.
[HttpPost]
public IActionResult Action()
{
    var data = JObject.Parse(this.HttpContext.Request.Form["data"]);
    var action = data["action"].ToString();
    switch (action)
    {
        case "Initialize":
            var initData = StiWebForm.Initialize(data, null);
            return Json(initData.Content);
        default:
            var result = StiWebForm.ProcessRequest(data);
            return result.ContentType switch
            {
                "application/pdf" => new FileContentResult(result.Content as byte[], result.ContentType),
                _ => Json(result.Content),
            };
    }
}

How it works. A single action multiplexes the form component's requests, so the Angular form talks to one endpoint for setup, editing and PDF output.

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.