Html to pdf some characters are missing (itextsharp)

前端 未结 11 1771
不思量自难忘°
不思量自难忘° 2020-12-06 02:34

I want to export gridview to pdf by using the itextsharp library. The problem is that some turkish characters such as İ,ı,Ş,ş etc... are missing in the pdf document. The cod

11条回答
  •  难免孤独
    2020-12-06 03:02

    For Turkish encoding

    CultureInfo ci = new CultureInfo("tr-TR");
    Encoding enc = Encoding.GetEncoding(ci.TextInfo.ANSICodePage);
    

    If you're outputting HTML, try different DOCTYPE tags at the top of the page.

    
    

    Note if using HTML you may need to HTMLEncode the characters.

    Server.HTMLEncode()

    HttpServerUtility.HtmlEncode()

提交回复
热议问题