I am having issues displaying Vietnamese text with html tags contained within the text. Here's an example of the XML:
Only the 1st character of each row is appearing.
Thanks
I am having issues displaying Vietnamese text with html tags contained within the text. Here's an example of the XML:
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:
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.