title: ASP.NET Rotativa Generate PDF from view from another controller
body: <p>I have two controllers, 1 is an api controller, the other is a view controller, what I am trying to do is generate the PDF from the api controller from a view in the view controller...is this possible and how would I do it?</p>
  
  <p>API Controller - This is where I want to generate the PDF</p>
  
  <pre><code>public byte[] getReportsPDF(string community, string procedure)
  {
              byte[] pdfBytes = new byte[] { };
  
              System.Web.Mvc.ControllerContext context = new System.Web.Mvc.ControllerContext();
  
              if(procedure == "GetProductionTasks")
              {
                  var actionPDF = new Rotativa.ActionAsPdf("RedBluePDF", new { community = community, procedure = procedure })
              {
                      PageSize = Size.A4,
                      PageOrientation = Rotativa.Options.Orientation.Landscape,
                      PageMargins = { Left = 1, Right = 1 }
                  };
                  pdfBytes = actionPDF.BuildFile(context);
              }
  
              return pdfBytes;
  }
  </code></pre>
  
  <p>View Controller - This is the view I want to generate.</p>
  
  <pre><code>public ActionResult RedBluePDF(string community, string procedure)
  {
      return View();            
  }
  </code></pre>