Reputation: 95
I tried to get Pdf Docs from my IActionResult method using APIs like RazorPdf,MvcPdfActionResult,PerfectPdf... But none is working for me. I am Developing an Application in ASP.NET Core MVC.
Are there any supported APIs for generating Pdfs from Controller Actions....?
Upvotes: 0
Views: 853
Reputation: 95
MvcPdfActionResult worked for me with... I just had to change the ViewName.
Instead of passing it directly, I tried giving it's relative path like ~/Views/PdfView.cshtml.
The actual code looks like this...
return new PdfActionResult("~/Views/PdfView.cshtml", modelobject)
Upvotes: 1