3

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?

friedemann_bach
  • 1,418
  • 14
  • 29
okla
  • 31
  • 1
  • 3
  • I was facing this problem before, you may have a look at my question " Convert arabic"unicode" content html or xml to pdf using itextsharp " that may help you http://stackoverflow.com/questions/16080741/convert-arabicunicode-content-html-or-xml-to-pdf-using-itextsharp – Mohamed Salah Jul 27 '15 at 14:33

1 Answers1

0

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 );
Brian Reiter
  • 1,339
  • 1
  • 10
  • 16