Having an issue with producing a PDF with an image in IText.
We're able to produce the text of the document using IText, but it is not pulling through the image.
We are following the text in their Ebook at https://kb.itextpdf.com/home/it7kb/ebooks/itext-7-converting-html-to-pdf-with-pdfhtml/chapter-1-hello-html-to-pdf
The code in question is below:
void createPdf(string baseUri, string html, string dest)
{
ConverterProperties properties = new ConverterProperties();
properties.SetBaseUri(baseUri);
HtmlConverter.ConvertToPdf(html, new FileStream(dest, FileMode.Create), properties);
}
And as far as we can see the issue is around the string baseUri
We have assumed that this is the directory where the image is held in our C# project in visual studio and have so far used the following to no avail as a string:
- /Images/
- /Images/NewLogo.png
- http://localhost:64070/Images/NewLogo.png
None of these have produced the image in the PDF and any help or suggestions would be greatly appreciated.