ITextSharp特殊字符(PDF) [英] ITextSharp special characters (PDF)

查看:136
本文介绍了ITextSharp特殊字符(PDF)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,CP世界的人:-),



我想知道是否有人可以帮助我使用不打印特殊字符的itextsharp。我遇到的问题是我使用ITextSharp生成pdf文档,但是特殊字符完全被忽略。



例如我输入名称和姓氏字段: JessiëStrongfièld



在pdf上它只打印 Jessi Strongfild



有没有人有扩展或某种解决方法?

解决方案

我认为这与Unicode有关。在打印到PDF之前将字符串转换为Unicode。


请参考以下链接


解决方案是确保所有字体都在字典中,因为它们中包含所需的字符。



例如Courier New.TFF中有必要的字符,并且会识别特殊字符,所以只需要包含一个包含字符的字体(在我的情况下几乎任何人都可以)

Hey people of the CP world :-),

I want to know if anybody can assist me with itextsharp that does not print special characters. The problem I am having is that I use ITextSharp to generate pdf documents, but special characters just gets ignore totally.

Like for instance I put in name and surname field: Jessië Strongfièld

On the pdf it just prints Jessi Strongfild.

Does anyone have an extension or some kind of fix around this?

解决方案

I think this has something to do with Unicode. Convert the string to Unicode , before printing to a PDF .


Please refer the following Link


The solution was to ensure all the fonts were in the dictionary as they have the needed characters in there.

For example "Courier New.TFF" has the necesary character in and will recognize the special characters so just had to include a font that has the characters (In my case almost any one will do)


这篇关于ITextSharp特殊字符(PDF)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆