jay_bp
1
I am trying to create a PDF from a sting of Japanese UNICODE characters. The output PDF does not show the Japanese characters.
ar pdf1 = new Aspose.Pdf.Generator.Pdf();
//pdf1.SetUnicode(); // Tried this ... also does not work
var sec1 = pdf1.Sections.Add();
sec1.Paragraphs.Add(new Aspose.Pdf.Generator.Text(SOME_UNICODE_STRING));
pdf1.Save("C:\\TEST.PDF");
I have attached the source TXT file (read into SOME_UNICODE_STRINGSOME_UNICODE_STRING variable), and the output PDF.
Any ideas? Is this a font issue?
Thanks!
Hi Jay,
Thank you for the details.
Please use Text.TextInfo class to set Unicode font for Japanese characters. Please see the following sample code for your reference.
var pdf1 = new Aspose.Pdf.Generator.Pdf();
// ...
var sec1 = pdf1.Sections.Add();
// ...
Text txt = new Aspose.Pdf.Generator.Text("AAA これは日本語の文章ですこれは日本語の文章です");
txt.TextInfo.IsUnicode = true;
txt.TextInfo.FontName = "Arial Unicode MS";
// ...
sec1.Paragraphs.Add(txt);
// ...
pdf1.Save(@"D:\AP Data\August2012\assist\TEST.PDF");
Thank You & Best Regards,