Itextsharp特殊字符,如< [英] Itextsharp special characters like <

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

问题描述

我正在使用itextsharp生成pdf,但我有一个要求显示<<和>>在pdf页面中,我该怎么做

I am generating pdf using itextsharp i have one requirement to display << and >> in the pdf page how can i do this

推荐答案

如果您知道特殊字符的实体编号,则可以使用以下代码轻松创建该特殊字符.

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));

用您的实体号代替945.希望这会有所帮助.

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

如果您拥有带有所需符号的字体,则iTextSharp中的FontSelector类将为您提供进一步的帮助.

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

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

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