I just need to render PDF from website in ASP.NET MVC. I have found quite interesting article about generating PDF from ASP.NET MVC. I think it could be done even better if the page is rendered through ActionFilterAttribute. My Idea is somesthing like that:
[EnableCompression]
[OutputCache(Duration=7200)]
[EvoPDFFilter]
public ActionResult DownloadAsPDF()
{
var model= GetModel();
return View(model); //return just HTML and convert it by filter to PDF
}
public class EvoPDFFilterAttribute: ActionFilterAttribute
{
//some code should be here. Is this solution even possible?
}
It is possible? How should look like the EvoPDFFilterAttribute?
I finally managed to do it :-)