Page 1 of 1

Many text color within single table cell/paragraph

PostPosted: Thu Mar 21, 2013 8:32 am
by greg100
Hello,

I decided to use docx4j in my app and I have problem.

In template .docx file I have few tables with data, client expect that the text in single ror would have many colors. For example values in range 1-3 will be in red but values 4-6 in green.


How can I change text color for paragraph (is it possible)?

I have no idea how to do that. Please give me some ideas or tips.

Many thanks

Re: Many text color within single table cell/paragraph

PostPosted: Thu Mar 21, 2013 10:06 pm
by jason
Start by reading the Getting Started document.

Amongst other things, it will suggest that you create a docx (in Word or LibreOffice/OpenOffice) with the features you want, then unzip it and look at the XML.

You can then replicate that using docx4j, either via the JAXB object factory, or unmarshalling a string containing that XML.

If you have problems, please post the XML you are trying to create, and the Java code you are using to do it.