I am using Rotativa to turn a Razor view into a PDF.
The PDF file is not downloading.
I can see it in Fiddler but the browser is not prompting for download - I have tried this with both IE and Chrome.
I also tried to download the file to a physical path using the solution in this question here. but that didn't work either because of the system couldn't access the folder (Access Denied).
Here is my code:
public ActionResult Index()
{
var model = new CustomerDashboardVM();
return View("Index", model);
}
public ActionResult print(int voucherID)
{
var pdf = new ActionAsPdf("Index", new { voucherID}) { FileName = "testInvoice.pdf", PageSize = Rotativa.Options.Size.A4};
// RotativaHelper.SaveHttpResponseAsFile("http://localhost:65425/BlankDashboard", Server.MapPath("~\\PdfDownloads"));
return pdf;
}
I wonder why is this happening - I click the button, it calls the print ActionResult method - no error messages (I wrapped this in a try and catch block). I have tried this on a colleague PC and it was the same issue!
Many thanks.