title: Mixed orientation portrait and landscape need to generate PDF from asp.net MVC C#
body: <p>We are using <a href="https://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html" rel="nofollow noreferrer">rotativa wkhtmltoPDF</a> to generate PDF in asp.net MVC C#.
  We were able to achieve all the required formating and indexing. All good..</p>
  
  <p>What we need is to have mixed orientation. Our some of the pages are portrait and some of them landscape. <strong>wkhtmltoPDF</strong> only support single orientation. </p>
  
  <p>Is there any way, we can use <strong>mixed orientation</strong> or <strong>any other library</strong> which we can use to achieve?</p>
  
  <p>Here is the code which we are using</p>
  
  <pre><code>string tocXslPath = Server.MapPath("/Rotativa/toc.xsl");
  string customSwitches = string.Format("--print-media-type --enable-smart-shrinking --header-html {0} --header-spacing \"4\" --footer-html {1} --footer-spacing \"4\" cover {2} cover {3} " + coverPages + " toc --xsl-style-sheet " + tocXslPath + " ", Url.Action("Header", "Home", new { area = "" }, "http"), Url.Action("Footer", "Home", new { area = "" }, "http"), Url.Action("CoverTitle", "Home", new { area = "" }, "http"), Url.Action("CoverAll", "Home", new { area = "" }, "http"), Url.Action("EmptyCover", "Home", new { area = "" }, "http"));
  
    return new Rotativa.ViewAsPdf("ProjectPdf")
    {
        FileName = "Project.pdf",
        CustomSwitches = customSwitches,
        PageMargins = { Top = 15, Bottom = 15 }
    };
  </code></pre>
  
  <p><strong>Here is the command which we are using for orientation</strong></p>
  
  <pre><code>--orientation landscape
  it made all pages landscape.
  </code></pre>