For now I use version 5.5.3 and it works without problems, but I try to update to newest one and I have problem with polish characters (they are just missing). I make conversion from rtf to html and from html to pdf like this:
private ElementList htmlToElementList(string htmlText)
{
ICSSResolver cssResolver = XMLWorkerHelper.GetInstance().GetDefaultCssResolver(true);
// HTML
HtmlPipelineContext htmlContext = new HtmlPipelineContext(null);
htmlContext.SetTagFactory(Tags.GetHtmlTagProcessorFactory());
htmlContext.AutoBookmark(false);
// Pipelines
ElementList elements = new ElementList();
ElementHandlerPipeline end = new ElementHandlerPipeline(elements, null);
HtmlPipeline html = new HtmlPipeline(htmlContext, end);
CssResolverPipeline css = new CssResolverPipeline(cssResolver, html);
// XML Worker
XMLWorker worker = new XMLWorker(css, true);
XMLParser p = new XMLParser(worker);
p.Parse(new StringReader(htmlText));
return elements;
}
It work like it should on 5.5.3. I try to investigate and I found one difference between them (5.5.3 vs 5.5.7): On each chunk in elements inside font BaseFont is not null only: ({itextSharp.text.pdf.TrueTypeFontUnicode})
on version 5.5.7 BaseFont is null.
I use only Century Gothic font (in html) (registered in FontFactory).
What is missing to get it work in new version?