它返回没有任何内容的空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>发布于 2017-02-10 18:58:58
你必须把这个放在你的视图上:
src="@Server.MapPath("~/images/e_lg.jpg")"https://stackoverflow.com/questions/40360222
复制相似问题