Page 1 of 1

How to read symbols from Docx

PostPosted: Mon Sep 23, 2013 9:59 pm
by gsb77
Hi ,

I am unable to read symbols from Dcox using Docx4j.
PFA for symbols ..

Sample xml :
<w:p w:rsidR="005F0E7C" w:rsidRDefault="00777D21" w:rsidP="005F0E7C">
<w:pPr>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri"/>
<w:sz w:val="20"/>
<w:szCs w:val="20"/>
</w:rPr>
</w:pPr>
<w:r>
<w:rPr>...</w:rPr>
<w:sym w:font="Symbol" w:char="F021"/>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:color w:val="1F497D"/>
</w:rPr>
<w:sym w:font="Symbol" w:char="F022"/>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:color w:val="1F497D"/>
</w:rPr>
<w:sym w:font="Symbol" w:char="F023"/>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:color w:val="1F497D"/>
</w:rPr>
<w:sym w:font="Symbol" w:char="F024"/>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:color w:val="1F497D"/>
</w:rPr>
<w:sym w:font="Symbol" w:char="F025"/>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:color w:val="1F497D"/>
</w:rPr>
<w:sym w:font="Symbol" w:char="F026"/>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:color w:val="1F497D"/>
</w:rPr>
<w:sym w:font="Symbol" w:char="F027"/>
</w:r>
<w:r>
<w:rPr>
<w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
<w:color w:val="1F497D"/>
</w:rPr>
<w:sym w:font="Symbol" w:char="F028"/>
</w:r>

Re: How to read symbols from Docx

PostPosted: Tue Sep 24, 2013 12:47 pm
by dazzfayaz
The symbols you have inserted belong to the SYMBOL font in word using the insert symbol option.
The peculiarity about these is that they are not unicode and word [may or be open xml] has defined some set of hexBinary codes for them.
You can find similar such codes in Wingdings, Wingdings2 font symbols.
Therefore I suggest you do not use such fonts if your application needs to show them on UI or something.
Or use this link which provides you the nearly equivalent unicodes for such characters.
http://www.alanwood.net/demos/symbol.html

Hope i answered the question.

Regards,