title: Rotativa ActionAsPdf() Very Slow
body: <p>Using <a href="https://www.nuget.org/packages/Rotativa" rel="nofollow">Rotativa 1.6.4</a> from NuGet and have noticed the following issue using the code below.</p>
  
  <p>ActionAsPdf hangs randomly for indeterminate amount of time.  </p>
  
  <p>Code below that is hanging:</p>
  
  <pre><code>   var pdfResult = new ActionAsPdf("Report", new {id = Request.Params["id"]})
      {
          Cookies = cookieCollection,
          FormsAuthenticationCookieName = FormsAuthentication.FormsCookieName,
          CustomSwitches = "--load-error-handling ignore"
      };
  </code></pre>
  
  <p><strong>Background info that may help:</strong> </p>
  
  <p>The customSwitches is in use to ignore a documented issue calling wkhtmltopdf.exe using the ActionAsPdf, but it does not suppress errors in the code only in the wkhtmltopdf call.</p>
  
  <p><strong>Observations, usage and testing:</strong> </p>
  
  <p>It works but when running the application (whether or not stepping through code), it can be anywhere from 10 seconds up to about 4 minutes between hitting the pdfResult = new ActionAsPdf and finally entering into the "Report" action being called.  Can't discern anything actually happening in the output window of Visual Studio, no errors are being thrown that I have found.  Just random slow transition into the Reports() action.</p>
  
  <p>I can run the Reports() action directly via URL and it never slows like this and is quite fast for PDF generation.  I am running it using the ActionAsPdf to obtain the binary to save to file system and send via email, which is the prescribed method of doing so for this library.</p>
  
  <p>The behavior exists on both a local Windows 10 dev box and a remote Server 2008R2 Test box.  .Net 4.5.1 on both boxes, default IIS on each.</p>
  
  <p><strong>Questions I have:</strong></p>
  
  <p>Any idea on what might cause this slow down and how to remedy it?</p>