Page 1 of 1

Html in docx Header

PostPosted: Sat Sep 19, 2015 1:46 am
by Bezerk
I am trying to to put some html code in docx header, but it just appear as simple text.
1 - It is possible to renderize html code in header part?
2 - If does, how can I do it?

Re: Html in docx Header

PostPosted: Sun Sep 20, 2015 9:47 pm
by jason
First, make sure it is XHTML.

Then you can use docx4j-ImportXHTML to convert it to docx content.

Or you can add it as an AltChunk, then tell docx4j to process altchunks (which it'll do, if you have docx4j-ImportXHTML on your classpath). So this is pretty much the same as above, but is a bit more complex and gives you less control :-)