簡體   English   中英

Rotativa頁腳圖片無效

[英]Rotativa footer image doesn't work

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

您必須將其放在您的視圖上:

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM