I was using this Rotativa 1.6.4 code example to generate a PDF from a page in my .NET MVC 5 app.
public ActionResult PrintIndex()
{
var a = new ActionAsP
In my case using UrlAsPdf() along with just adding the cookie that I needed, had resolved the issue. Following is the sample code that I have used.
var report = new UrlAsPdf(url);
Dictionary cookieCollection = new Dictionary();
foreach (var key in Request.Cookies.AllKeys)
{
if (Crypto.Hash("_user").Equals(key))
{
cookieCollection.Add(key, Request.Cookies.Get(key).Value);
break;
}
}
report.Cookies = cookieCollection;
report.FormsAuthenticationCookieName = FormsAuthentication.FormsCookieName;