|
Rank: Newbie Groups: Member
Joined: 2/19/2012 Posts: 4
|
Hi,
When i create pdf document, which has some text with Chinese characters,in result document doesn't display this text. Only empty spaces. So, how i can generate pdf with Chinese characters?
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
Make sure you explicitly reference the Chinese font name in your style. For example:
<div style="font-family:SimSun"> Chinese here.... </div>
And also make sure you have the Chinese font used installed on your server.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 2/19/2012 Posts: 4
|
Hi, I have some code like this:
PdfDocument doc = new PdfDocument(); AcmRender render = new AcmRender(doc); AcmText text = new AcmText("123"); text.Style.FontName = "Courier New"; text.AutoTrim = false;
AcmText text2 = new AcmText("アーク"); text2.Style.FontName = "Courier New"; text2.AutoTrim = false; render.Render(text); render.Render(text2);
So, problem is in rendering text2 variable - chinese characters with this settings for font dont display. Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
The answer is the same ---- you have to use the correct font. In your case, "Courier New" does not any data for those characters ("アーク" is Japanese). Try font "MS Mincho" and you will see them rendering correctly.
If you use HTML to PDF, we will automatically substitute font --- that if, if we see a character that the current font does not have any data, we will automatically search for a "suitable" font and use that font instead. However for ACM interface, we do not do font substitution, so you have to always specify the correct font.
Thanks!
|
|