I have been trying to render an image but with no positive result. Is there anything specific I need to add to make it work. I am not including the rest of the View which renders fine, but in the pdf, the image is missing.
I have followed the below link:
https://github.com/andyhutch77/MvcRazorToPdf
View
@model Test.Models.PdfExample
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_Layout.cshtml";
var imagePath = Server.MapPath("~/Content/Images");
}
<div style="width: 200%; height: 80px;">
<div>
<img alt="Test123" src="@imagePath\image.jpg" /> // not rendering
@*<img alt="Test123" src="@Url.Content("~/Images/image.jpg")" />*@
</div>
</div>
I can see that the <div>
is occupying the width and height
but it is not showing the image inside of it.