2016-11-01 21 views
0

Es gibt leere pdf ohne Inhaltrotativa Fußzeile Bild funktioniert nicht

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

Ansicht

<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> 
+0

hast du eine Aktion namens "Pdf"? Wenn ja, was bringt es zurück? – meJustAndrew

Antwort

0

Sie diese auf Ihrer Ansicht setzen:

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

eine kleine Erklärung würde helfen –

+0

ok ...? und nun? – Danilo