Rotativa页脚图像不起作用

时间:2016-11-01 12:36:59

标签: c# rotativa

它返回没有任何内容的空pdf

string customSwitches = string.Format( "--header-right \"text\" --footer- html {0}",
         Url.Action("Footer", "Competition", new { area = "" }, "http"));

return new ActionAsPdf("Pdf", new { compId = compId, personId = personId })
{
    //FileName = "Report.pdf",
    CustomSwitches = customSwitches
};

查看

<div style="text-align:center;font-size:11px;border-top:2px solid black;height:20%;padding-bottom:300px">
   <img style="width:12px" src="~/images/e_lg.jpg" />
</div>

1 个答案:

答案 0 :(得分:0)

你必须把它放在你的观点上:

src="@Server.MapPath("~/images/e_lg.jpg")"