In order to display the Amharic text in PDF document, you need to try using the font which supports these characters/language. I have tested the scenario where I have used Amharic-VG2 Main.ttf and as per my observations, only one characters is appearing in resultant document. For
the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-34656. We
will investigate this issue in details and will keep you updated on the status
of a correction.
We
apologize for your inconvenience.
PS, For your reference, I have also attached the resultant PDF which I have generated over my end.
Thanks a lot for your quick answer. I discover that the font named “Nyala” worked with amharic. In fact I copied/pasted my characters in amharic language in a word processor software and it chose itself this font.
Then I tried to apply it to my code and it worked. txt.TextInfo.FontName = “Nyala”;
Then I can use a regexp like this one : var regex = new Regex(@"[\p{IsEthiopic}]"); regex.IsMatch(“የአዲሱ ጠ/ሚ ሹመት መፅደቅ”); Which send me true when found Ethiopic and Amharisch characters and then I can change my fontName depending on it.
Hope it will help other people and thanks a lot for giving me the idea
Sorry, I’m here again. In my table where I can have amharic characters, I have other characters so all the cells are not with the same font. Below you can see my code where I add two cells in a table and use two different font in the two cells. As soon as I’m doing that the amharic doesn’t display anymore.
Can you help me again, please ?
Here’s my code
Aspose.Pdf.Generator.Pdf pdfConv = new Aspose.Pdf.Generator.Pdf(); Aspose.Pdf.Generator.Section sec1 = pdfConv.Sections.Add();
Aspose.Pdf.Generator.Table tab = new Aspose.Pdf.Generator.Table(); tab.ColumnWidths = “500”; Aspose.Pdf.Generator.Row rowContent = tab.Rows.Add(); var cell = rowContent.Cells.Add(“የአዲሱ ጠ/ሚ ሹመት መፅደቅ”); var borderColor = new Color { ColorSpaceType = ColorSpaceType.Rgb, RgbColorSpace = System.Drawing.Color.Black }; cell.Border = new BorderInfo(); cell.Border.Top = new GraphInfo { Color = borderColor, LineWidth = 0.5f }; cell.Border.Bottom = new GraphInfo { Color = borderColor, LineWidth = 0.5f }; cell.Border.Left = new GraphInfo { Color = borderColor, LineWidth = 0.5f }; cell.Border.Right = new GraphInfo { Color = borderColor, LineWidth = 0.5f }; cell.DefaultCellTextInfo = new TextInfo { FontName = “Nyala”, IsUnicode = true };
I have tested the scenario and have observed that the reason Amharic characters do not appear in PDF file is because after adding cell in second row, you have specified Arial Unicode MS as font for cell in first row of table containing Amharic characters. Simply update the code as
I am glad to hear that your problem is resolved and you are able to accomplish your requirements. In the event of any further query, please feel free to contact.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.