title: Display dynamic header using Rotativa pdf in MVC
body: <p>I wanted to print header data which are dynamic and will come from controller.</p>
  
  <p>So how can I display that dynamic data in header using Rotativa pdf.</p>
  
  <p>My header data include Name, Address, Contact info and other additional information, which are dynamic and generated from controller side.</p>
  
  <p>I have created pdf with static header as below by using html page </p>
  
  <pre><code>string header = Server.MapPath("~/Static/NewFolder/PrintHeader.html");
   string footer = Server.MapPath("~/Static/NewFolder/PrintFooter.html");
  
   string customSwitches = string.Format("--header-html  \"{0}\" " +
                          "--header-spacing \"0\" " +
                          "--footer-html \"{1}\" " +
                          "--footer-spacing \"10\" " +
                          "--footer-font-size \"10\" " +
                          "--header-font-size \"10\" ", header, footer);
  
  return new ViewAsPdf("SchedulePrintPdf", modelData)
                      {
                          CustomSwitches = customSwitches,
                          PageOrientation = Orientation.Portrait,
                          PageMargins = { Top = 20, Bottom = 22 },
                          SaveOnServerPath = filePath, FileName = Path.GetFileName(fileName)
                      };
  </code></pre>
  
  <p>This is working well with Static header.</p>
  
  <p>Now I need the header text will go from this controller dynamically.</p>