Itextsharp and arabic character?

会有一股神秘感。 提交于 2019-12-23 21:24:08

问题


i have use itextsharp to convert html to pdf(using asp.net C#) and its work in english characters , but when i want to convert html including arabic characters it will give me empty pdf !!

can any one help me?


回答1:


The problem is that your font does not have glyphs for the Arabic code points. You need to embed a font that has Arabic glyphs such as arabtype.ttf.

string fontpath = Environment.GetEnvironmentVariable( "SystemRoot" ) + "\\fonts\\arabtype.ttf";
BaseFont basefont = BaseFont.CreateFont( fontpath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED );
Font arabicFont = new Font( basefont, 10f, Font.NORMAL );


来源:https://stackoverflow.com/questions/2472384/itextsharp-and-arabic-character

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!