Пример #1
0
        public IActionResult Confirm_PDF_details(PDF_ inp)
        {
            var    response    = new HttpResponseMessage();
            string result_view = "<form method='post' asp-controller='Home' action='ToPdf'>Name: <input name='Name' readonly='true'  value='" + inp.Name + "'/><br> Address: <input name='Address' readonly='true' value='" + inp.Address + "'/><br> Amount: <input readonly='true'  name='Amount' value='" + inp.Amount + "'/><input type='submit' value='confirm'></form> ";


            ViewBag.result_view = result_view;

            return(View());
        }
Пример #2
0
        public IActionResult ToPdf(PDF_ inp)
        {
            var root    = "wwwroot/PDF_Data/";
            var pdfname = inp.Name + ".pdf";
            var path    = Path.Combine(root, pdfname);

            path = Path.GetFullPath(path);
            var report = new ViewAsPdf("PDF_template", inp)
            {
                PageMargins      = { Left = 20, Bottom = 20, Right = 20, Top = 20 },
                PageOrientation  = Rotativa.AspNetCore.Options.Orientation.Portrait,
                SaveOnServerPath = path,
            };

            return(report);
        }