Adding symbols to word document using docx4j -


I'm trying to dock a wingedink symbol using the following code.

  p symp = factory.createP (); R symr = factory.createR (); Sym sym = factory.creaters (); Sym.setFont ("wingdings"); sym.setChar ("FOFC"); . Add symr.getContent () (symbol); . Add symp.getContent () (symr); . Add MainPart.getContent () (symp); I get invalid content errors when I open the document, when I try to add symbols to docking the words directly, open the DockX and see the document. xml, give me paragraphs There are rsidR and rsidDefault features. When I read about these features from this link, I see that they are random and only necessary to track changes to the document. Then, why did Microsoft Word expect this and I made a mistake?  

Any ideas / suggestions?

I am surprised that Sym is supported by you in docx4j is.

I tried your code and I got the same problem, but I should accept it before I check the symbols. As an experiment, I added an icon using the relevant "Insert" menu command in Word 2010, and after that result OpenXMLA was checked, when it was actually inserting the Sym element Much different than the mark-up.

Rather than teasing the symbols, have you tried to insert the text directly? For example, it will insert a tick character (not sure if you have the above version):

  PP = Factory .createP (); RR = FACTORY. CREATOR (); RPR RRP = FACTORY. CREATE RPR (); Text text = factory.credited text (); RFonts rfonts = factory.createRFonts (); rfonts.setAscii ("wingdings"); rfonts.setCs ("wingdings"); rfonts.setHAnsi ("wingdings"); Rpr.setRFonts (rfonts); r.setRPr (RPR); text.setValue ("\ uFFFC"); . R.getContent () add (text); . Connecting P.getContent () (R); . Adding MainPart.getContent () (P);    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -