Free Support Forum - aspose.com

Unicode and Version 1.5.15

I wasn’t able to generate PDF document which has unicode (Vietnamese language) with Aspose v1.5.15.

Is Aspose v1.5.15 support unicode?

If so, can you give me some sample code?

Below is the text that I used for my unicode testing:

Vi?t Nam, Vi?t Nam tên g?i là ngu?i
Vi?t Nam hai cau nói trên vành m?i
Vi?t Nam nu?c t?i
khi g? ch? Vi?t theo cách


Thanks


Dear VNetBoy,

Thanks for your consideration.

Yes v1.5.15 supports unicode. But there are some bugs in it, so you’d better upgrade to the latest hot fix.

Here is an example:

[XML]
<?xml version="1.0" encoding="utf-8" ?>




Vi?t Nam, Vi?t Nam tên g?i là ngu?i




[C#]
Pdf pdf = new Pdf();

Section section = new Section(pdf);
pdf.Sections.Add(section);

Text text1 = new Text(section);
section.Paragraphs.Add(text1);

Segment segment1 = new Segment(text1);
text1.Segments.Add(segment1);
segment1.TextInfo.FontName = “Arial”;
segment1.TextInfo.IsUnicode = true;
segment1.TextInfo.TruetypeFontFileName = “c:/windows/fonts/Arial.ttf”;
segment1.Content = “Vi?t Nam, Vi?t Nam tên g?i là ngu?i”;

pdf.Save(…);

[VisualBasic]
Dim pdf As Pdf = New Pdf()

Dim section As Section = New Section(pdf)
pdf.Sections.Add(section)

Dim text1 As Text = New Text(section)
section.Paragraphs.Add(text1)

Dim segment1 As Segment = New Segment(text1)
text1.Segments.Add(segment1)
segment1.TextInfo.FontName = “Arial”
segment1.TextInfo.IsUnicode = True
segment1.TextInfo.TruetypeFontFileName = “c:/windows/fonts/Arial.ttf”
segment1.Content = “Vi?t Nam, Vi?t Nam tên g?i là ngu?i”

pdf.Save(…)


Thanks for the sample code.

I download the latest hot fix and try it. It works beatifully.


Great product