I'm using Rotativa.MVC 2.0.3 in my MVC5 project. I keep getting an error in the code editor stating "ActionAsPDF does not contain a definition for CustomSwitches". I tried using ViewAsPDF as shown in the links below also, same result. Here are a couple of sources I found regarding how to add headers/footers to Rotativa PDFs:
The code in my controller is:
using Rotativa.MVC;
public ActionResult CertificatePDF(int? wo_nbr)
{
var PDFresult = new ActionAsPdf("Certificate", new { wo_nbr = wo_nbr })
{
FileName = "Certificate.PDF",
CustomSwitches = "fill in details later"
};
return PDFresult;
}
So the question is: How do I implement CustomSwitches in Rotativa 2.0.3? Or, where is the CustomSwitches definition? The PDF renders terrifically without the CustomSwitches tag, so I know Rotativa is doing it's job.