2
I have an Action responsible for generating the pdf using Rotary... The action code is as follows::
public ActionResult PDFPadrao()
{
string header = Server.MapPath("~/Views/Relatorio/Header.html");
string customSwitches = string.Format("--header-html \"{0}\" " , header);
var pdf = new ViewAsPdf()
{
ViewName = "Modelo",
CustomSwitches = customSwitches
};
return pdf;
}
The contents of the Header.html file are as follows::
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div>
<img src="@Server.MapPath('~/Images/337946.png')"/>
</div>
</body>
</html>
I want to render this image in the pdf, but it is not being rendered, just this appears:
How can I solve?
If memory serves me correctly
scr
needs to be a virtual path. Ex.:https://seudominio.com/Images/337946.png
– Leandro Angelo
Man, thank you so much! It really helped me!!!
– José Furtado