Hi,
I'm trying to get Unicode symbols to render in a table using the Unicode code symbols and a FormattedTextArea. Each time I try different symbols, it appears that the Unicode Code Point is just rendered "as-is", as if it were just text.
Here is my code (C#) for adding the text to the PDF:
Font unicodeFont = new OpenTypeFont(@"ARIALUNI.TTF");
FontFamily family = new FontFamily("ArialFont", unicodeFont);
var text = "\\U00C6";
FormattedTextArea area = new FormattedTextArea(text, 0,0,150, 150, family, 14, true);
Row2 newRow = _theTable.Rows.Add(ROWHEIGHT, unicodeFont, ROWFONTSIZE);
newRow.Cells.Add(area);
When this table renders, I get the following text:
"\U00C6"
Am I missing something?
Thanks.
Unicode Symbols in FormattedTextArea
Re: Unicode Symbols in FormattedTextArea
Support · Mar 7, 2018Hello,
When you specify the Unicode hex value as a string use single \ and a lower case “u” as shown below.
var text = "\u00C6";
Thanks,
ceTe Software Support Team.
Re: Unicode Symbols in FormattedTextArea
Forum member · Mar 8, 2018Thank you so much! This now works!
Re: Unicode Symbols in FormattedTextArea
Forum member · Apr 13, 2018The following is not working...
Dim fta As FormattedTextArea = New FormattedTextArea("\u003C LESS-THAN SIGN", 50, 400, 100, 20, FontFamily.Helvetica, 14, True)
pg.Elements.Add(fta)
Displays
Dim fta1 As FormattedTextArea = New FormattedTextArea("\u00C6 LESS-THAN SIGN", 50, 450, 100, 20, FontFamily.Helvetica, 14, True)
pg.Elements.Add(fta1)
In both cases, it is not translating into the specified character.
I'm using 9.0.0.35070
Re: Unicode Symbols in FormattedTextArea
Support · Apr 16, 2018Hi,
We are looking into this issue and will post an update as soon as we complete our analysis.
Thanks,
ceTe Software Support Team.
Re: Unicode Symbols in FormattedTextArea
Support · Jun 29, 2018Hello,
The Syntax to add the Unicode values with VB.NET is differs from the C# code. Below is the code sample to add the symbol using Unicode values using VB.NET.
Dim fta1 As FormattedTextArea = New FormattedTextArea(ChrW(198) & "Symbol", 50, 450, 100, 20, FontFamily.Helvetica, 14, True)
Please note that if you would like to add the less-than (& l t ; ) or greater-than (& g t; )symbols to the PDF using FormattedTextArea then please use the HTML entities. Below is the code sample.
Dim fta As FormattedTextArea = New FormattedTextArea("< LESS-THAN SIGN", 50, 400, 200, 20, FontFamily.Helvetica, 14, True)
Dim fta2 As FormattedTextArea = New FormattedTextArea("> GREATER-THAN SIGN", 50, 500, 200, 20, FontFamily.Helvetica, 14, True)
Thanks,
ceTe Software Support Team.