I'm trying to generate documents using TuesPechkin and so far it's working flawlessly when it comes to URL images. However, when it comes to local images it doesn't seem to generate the image at all as shown here:
https://i.stack.imgur.com/UVjjr.jpg
Document Generation:
public static void ConvertDoc(String html)
{
var document = new HtmlToPdfDocument
{
GlobalSettings =
{
ProduceOutline = true,
DocumentTitle = "Form documents",
Margins =
{
Top = 1.8,
Left = 2.5,
Right = 2.5,
Bottom = 2.5,
Unit = Unit.Centimeters
}
},
Objects =
{
new ObjectSettings { HtmlText = html,
WebSettings = new WebSettings() {
LoadImages = true
}
}
}
};
IConverter converter = new ThreadSafeConverter(
new PdfToolset(
new Win32EmbeddedDeployment(
new TempFolderDeployment())));
byte[] result = converter.Convert(document);
File.WriteAllBytes("C:/Users/jmann_000/Desktop/Test/program-test-2015.pdf", result);
}
}
}
As seen above, I have also tried setting load images to true which did not work. Html in question:
<td>
<table border="0" cellpadding="0" cellspacing="0" class="doc-header">
<tr>
<td width="300" align="left"><img src="img/logo.gif" width="240" alt="AeroCare"></td>
<td width="375"></td>
</tr>
</table>
</td>
Is there a correct way to generate the image if its local?