I have setup some code to perform some formatting. I can use JcEnumeration.RIGHT, LEFT, CENTER and it applies the w:jc tag appropriately. But when I use BOTH or DISTRIBUTED nothing gets set in the document xml for the w:jc tag.
I notice that Word uses "BOTH" for justify alignment. Either way (BOTH or DISTRIBUTED) my code does not work. Here is an example of how I set CENTER which works and then the same approach for BOTH or DISTRIBUTED:
- Code: Select all
//This works
Jc alignment = new Jc();
alignment.setVal(JcEnumeration.RIGHT);
//paragraph is an instance of P
paragraph.getPPr().setJc(alignment);
//This does not work
Jc alignment = new Jc();
alignment.setVal(JcEnumeration.BOTH); //Have used DISTRIBUTED also
paragraph.getPPr().setJc(alignment);
As I said, the second version no w:jc tag gets set in the document
Thanks.