Scenario
Using Rotativa as PDF convertor in ASP.NET MVC C# with Active directory login authentication
Problem
Cause :
If you use Rotativa.ActionAsPDF it will not pass the header values related to authentication to the new page. So option is to use Rotativa.PartialViewAsPdf
Sample Code:
public ActionResult ConvertToPDF(string stdId, string vid)
{
TestModel model = dbfunctions.GetTestValue(stdId, vid);
// send model as partial View Pdf not
return new Rotativa.PartialViewAsPdf(“TestPDF”, model);
}
public ActionResult TestPDF(TestModel model) // model with values
{
// PartialView(pdf) not View(pdf);
return PartialView(model);
}