2017-09-29 32 views
1

我们正在使用rotativa wkhtmltoPDF在asp.net MVC C#中生成PDF。 我们能够实现所有需要的格式化和索引。所有的好..混合定位肖像和风景需要从asp.net MVC C生成PDF#

我们需要的是有混合的方向。我们的一些页面是肖像,其中一些是风景。 wkhtmltoPDF只支持单向。

有什么办法,我们可以使用混合定向任何其他库,我们可以用它来实现?

这里是我们使用

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 } 
    }; 

的代码下面是我们所使用的方向

--orientation landscape 
it made all pages landscape. 
+0

嘿,你为什么为这个答案添加点。 https://stackoverflow.com/posts/184701/revisions –

回答