Rectangle 27 0

After browsing the 5.0.2 code, it looks like there is no document that will just take XML and turn it into a PDF for you. So, unless you can find similar code on the web or in an old release of iTextSharp, you'll need to write it yourself.

c# - Trouble with ITextSharp - Converting XML to PDF - Stack Overflow

c# xml pdf-generation itextsharp
Rectangle 27 0

I've had similar problem with iTextSharp. The solution was in setting "substitution" font. The method is called something like setSubstitutionFont(BaseFont).

Java: Characters in pdf cannot be rendered correctly - Stack Overflow

java pdf fonts pdf-generation
Rectangle 27 0

If you know the entity number of the special character you can create that special character simply by using the following code.

document.Add(Phrase.GetInstance(" This is " + (char)945));

Substitute your entity number instead of 945. Hope this helps.

Edit: FontSelector class in iTextSharp will help you further if you have the required font with the symbols.

Itextsharp special characters like < - Stack Overflow

itextsharp special-characters
Rectangle 27 0

I'd imagine that you need to HTML encode any literal text you're trying to insert - & would generally be interpreted as the start of an entity, and should normally be encoded as . There's support for HTML encoding in HttpServerUtility.HtmlEncode.

However, we do need to be careful here, since the reported error concerns an XML error, and the list of named entities differs between HTML and XML. I've just been looking in the System.Xml namespace, and can't find any class that specifically helps you produce valid XML data - you might alternatively choose to place your text literals inside a CDATA (<![CDATA[, ]]>) section.

.net - How to show the special characters like & in the pdf report gen...

.net pdf-generation itextsharp