webgio / Rotativa

Rotativa, /rota'tiva/. Make Pdf from Asp.Net MVC. Available on Nuget https://www.nuget.org/packages/Rotativa
http://letsfollowtheyellowbrickroad.blogspot.it/search/label/Rotativa
MIT License
621 stars 223 forks source link

Images not rendering #134

Open lhsomoza opened 8 years ago

lhsomoza commented 8 years ago

Objective: generate e-mail with embeded image, as well as generate email attachment as pdf with image in it. In this case all images are retrieved from Database, not stored in the server file system at all. The View becomes the body of the e-mail and in the View, When using :

The action method acquires the image from the database. It' shows fine in the body of the e-mail, but it is missing in the pdf. The conversion of the View to PDF gets executed, but the image is not displaying. I looks like the conversion to pdf is executed before the image is acquired. Any suggestions???

Perhaps it will be nice to be able to capture a rendered view first as a string and then do the conversion to PDF of the string which will contain the embedded image, but I do not see any Rotativa action method that will take a string and do the conversion to pdf.

paulodiogo commented 7 years ago

You can use @Server.MapPath("~/path/to/your/image.png")