【问题标题】:Rotativa footer image doesn't workRotativa 页脚图像不起作用
【发布时间】:2016-11-01 12:36:58
【问题描述】:

它返回没有任何内容的空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>

【问题讨论】:

  • 你有一个名为“Pdf”的动作吗?如果是,它返回什么?

标签: c# rotativa


【解决方案1】:

你必须把它放在你的视野中:

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

【讨论】:

  • 稍微解释一下会有所帮助
猜你喜欢
  • 2016-11-22
  • 2012-12-19
  • 2017-11-30
  • 1970-01-01
  • 2016-05-02
  • 1970-01-01
  • 2015-08-13
  • 2011-06-27
  • 1970-01-01
相关资源
最近更新 更多