Is it possible to bold a single word within a sentence with iTextSharp? I’m working with large paragraphs of text coming from xml, and I am trying to bold several individual words without having to break the string into individual phrases.
Eg:
document.Add(new Paragraph("this is <b>bold</b> text"));
should output…
this is bold text
As @kuujinbo pointed out there is the
XMLWorkerobject which is where most of the new HTML parsing work is being done. But if you’ve just got simple commands like bold or italic you can use the nativeiTextSharp.text.html.simpleparser.HTMLWorkerclass. You could wrap it into a helper method such as:Then instead of this:
You could use this: