MvcRazorToPdf How to download file using ajax call? MVC

204 views Asked by At

I tried to use MvcRazorToPdf, i can able to generate mail merge letters. My aim is after downloading file i want to return json message from controller. how to do?

Controller: [how to convert the below lines to generate pdf and download without return]
return new PdfActionResult(pdfres, (writer, document) =>
{
 document.SetPageSize(new Rectangle(PageSize.A4));
 document.NewPage();
})
{
 FileDownloadName = "ElanWasHere.pdf"
};

I appreciate your help. thanks

0

There are 0 answers