Html to pdf some characters are missing (itextsharp)

前端 未结 11 1767
不思量自难忘°
不思量自难忘° 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 02:59

    Don't change the source code of the iTextSharp. Define a new style:

            var styles = new StyleSheet();
            styles.LoadTagStyle(HtmlTags.BODY, HtmlTags.FONTFAMILY, "tahoma");
            styles.LoadTagStyle(HtmlTags.BODY, HtmlTags.ENCODING, "Identity-H");
    

    and then pass it to the HTMLWorker.ParseToList method.

提交回复
热议问题