Welcome Guest Search | Active Topics | Sign In | Register

Chinese characters don't display in generated document Options
Andrew Usikov
Posted: Friday, August 31, 2012 3:15:50 AM
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!
eo_support
Posted: Friday, August 31, 2012 8:03:19 AM
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!
Andrew Usikov
Posted: Monday, September 3, 2012 3:34:32 AM
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!
eo_support
Posted: Monday, September 3, 2012 1:12:11 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.