title: Why does Rotativa always generate my login page? Why is it slow?
body: <p>I was using this Rotativa 1.6.4 code example to generate a PDF from a page in my .NET MVC 5 app.</p>
  
  <pre><code>public ActionResult PrintIndex()
  {
      var a = new ActionAsPdf("Index", new { name = "Giorgio" }) { FileName = "Test.pdf" };
      a.Cookies = Request.Cookies.AllKeys.ToDictionary(k =&gt; k, k =&gt; Request.Cookies[k].Value);
      a.FormsAuthenticationCookieName = System.Web.Security.FormsAuthentication.FormsCookieName;
      a.CustomSwitches = "--load-error-handling ignore";
      return a;
  }
  
  public ActionResult Index(string name)
  {
      ViewBag.Message = string.Format("Hello {0} to ASP.NET MVC!", name);
  
      return View();
  }
  </code></pre>
  
  <p>It was not printing the Index page, but instead was printing my login page.</p>
  
  <p>Once I fixed the authentication issue, PDF generation was extremely slow even with <code>CustomSwitches</code>.  (Several minutes)</p>
  
  <p>The above code might actually work for you - it got around the authentication issue using the <code>Cookies</code> property, but it was way too slow for me.</p>
  
  <p>How do I print a secure page as well as do it quickly?</p>