I am trying to use EvoPdf library (demo version). I have html string with a full path to an image for example:
finalString.Append(@"<img src='http://www.ladessertelocale.com/2618-home_default/tomate-bio-1-kg.jpg'/>");
I used the following code to generate the pdf. The pdf file is generated with all the content but the image does not show on the pdf generated. A red x is shown in place of the image.
HtmlToPdfConverter converter = new HtmlToPdfConverter{
LicenseKey = "",
HtmlViewerWidth = 1024,
PdfDocumentOptions = { PdfPageSize = PdfPageSize.A4, PdfPageOrientation = PdfPageOrientation.Portrait, InternalLinksEnabled = true }
};
byte[] outPdfBuffer = null;
outPdfBuffer = converter.ConvertHtml(finalString.ToString(), "");
return File(outPdfBuffer, "application/pdf");
Am I missing something?
As suggested by Batuta, I changed the image html to below (base64 string truncated).
I used this website to upload the image and get base64 string representation of the image. http://imagetobase64.com/