Vietnamese characters

I am having issues displaying Vietnamese text with html tags contained within the text. Here's an example of the XML:


Tốc độ lọc cầu thận phỏng (eGFR) của bạn là 103.61 mL/min/1.73m<SUP>2</SUP>.
Điều này có thể nói lên là chức năng thận bình thường.

Only the 1st character of each row is appearing.

Thanks

Hello Terri,

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNET-27321. We will investigate this issue in details and will keep you updated on the status of a correction. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We apologize for your inconvenience.

Hello Terri,

Thanks for your patience.

We have further investigated and have found that the problem can be resolved if you try using pdf1.SetUnicode(); method before saving the resultant PDF. I have again tested the scenario using following code snippet with Aspose.Pdf for .NET 5.3.0 and I am unable to notice any problem. For your reference, I have also attached the resultant PDF.

In case the problem still persists or you have any further query, please feel free to contact.

[C#]


//Instantiate Pdf pbject by calling its empty constructor
Aspose.Pdf.Pdf pdf1 = new Aspose.Pdf.Pdf();
//Create a new section in the Pdf object
pdf1.BindXML(@"d:/pdftest/XMLFile1.xml",null);
// include the UniCode characters and custom font information in resultant PDF
pdf1.SetUnicode();
//save the resultant PDF
pdf1.Save(@"d:/pdftest/VietnamCharacterIssue_Test.pdf");

thanks for the reply. We now realize that you don't have to use the property IsAutoFontAdjusted for Vietnamese text. But we do have to use it for Chinese text to appear. This is still a problem for Chinese,so I believe it must be tied to the use of the property IsAutoFontAdjusted. The HTML tags are being ignored and causing the text to be truncated.

See binding code below:

pdf.TextInfo.FontName = "Arial Unicode MS";

pdf.IsAutoFontAdjusted = true;

pdf.SetUnicode();

Sample Chinese XML:





健康和人類服務部疾病控制和預防中心全國健康與營養體檢調查全國健康統計中心3311 Toledo Rd.
Hyattsville, Maryland 20782


7/1/2011

John Doe
123 Oakley Rd
Anywhere, ND 00000


親愛的父母或監護人,

最近,您的孩子參加了由全國健康統計中心、疾病控制和預防中心部分機構進行的全國健康與營養體檢調查 (NHANES)。我們審查了您的孩子於 4/21/2011 日進行的檢查的測試結果,發現一些數值 <U> 異常 </U>,需要您 <U> 立即注意 </U>。

我們不能確定這些測試結果是否表示您的孩子已生病。只有您孩子的醫生才能判定。我們 <B> 強烈建議 </B> 您與您孩子的醫生進行討論,並向其出示隨附表單上的測試結果。他或她能夠評估這些結果,幫助您瞭解它們對您孩子的健康有何意義。NHANES 計畫將不會支付您的孩子可能需要進行的任何後續測試或治療的費用。

檢查不是完整的體檢,也不能代替去看醫生。我們的調查醫生未被授權對調查參加者進行治療或持續任何追蹤。

您將來會收到您孩子的檢查結果的完整報告,但我們認為,您應該立即知道這些結果。

如果您有任何問題,您可以在週一至週五東部時間上午 8:30 至下午 6:00 撥打以下我們的免費電話之一與我聯絡。


I guess what I'd really like to know is how can I get Chinese and Korean text to appear without the use of the IsAutoFontAdjusted set to true? Is there a way to do this?

Thanks, Terri

Hello Terri,

Thanks for sharing the details.

In order to properly display Chinese and Korean text in resultant PDF without using IsAutoFontAdjusted property, please try specifying the FontName information inside XML file. I have updated the source XML file and as per my observations with v5.3.0, the text is properly being displayed in resultant PDF file. For your reference, I have also attached the updated XML file and the resultant PDF that I have generated. In case you still face any problem or you have any further query, please feel free to contact. We apologize for your inconvenience.

[C#]

//Instantiate Pdf pbject by calling its empty constructor
Aspose.Pdf.Pdf pdf1 = new Aspose.Pdf.Pdf();
//Create a new section in the Pdf object
pdf1.BindXML(@"d:/pdftest/text_view.xml", null);
// include the UniCode characters and custom font information in resultant PDF
pdf1.SetUnicode();
//save the resultant PDF
pdf1.Save(@"d:/pdftest/ChineseKoreanCharacters_Test.pdf");

PS, I have specified the FontName information in table tag as it will be used as DefaultCellTextInfo.

The issues you have found earlier (filed as 27321 ) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.