I assume the issue is converting htmltext with image to pdf
Try changing the following line
XMLWorkerHelper.GetInstance().ParseXHtml(pdfWriter, doc, new StringReader(htmlTable));
with
using (var htmlMemoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(htmlTable)))
{
iTextSharp.tool.xml.XMLWorkerHelper.GetInstance().ParseXHtml(pdfWriter, doc, htmlMemoryStream, System.Text.Encoding.UTF8);
}
and if you are using external css
using (var cssMemoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(cssText)))
{
using (var htmlMemoryStream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(htmlTable)))
{
iTextSharp.tool.xml.XMLWorkerHelper.GetInstance().ParseXHtml(pdfWriter, doc, htmlMemoryStream, cssMemoryStream);
}
}
Hope this help