Page 1 of 1

Positioning text in a header or footer

PostPosted: Sun Feb 10, 2013 8:00 am
by davethedog
Hi There,

I can't work out how to position the text in a header or footer - left, centre, right.

I can do it by using the XML Word generates and adding it with...

Code: Select all
Ftr footerPart = (Ftr) XmlUtils.unmarshalString(footerXML);


But this makes dynamic content difficult to manage. Am I missing someting?

Re: Positioning text in a header or footer

PostPosted: Sun Feb 10, 2013 9:48 am
by jason
You can do it using a table, or tabs.

If you don't want to unmarshall a string of XML, you can do it using the ObjectFactory. There is also a class in docx4j to help with creating a table.

But there is no high level method designed specifically to help you to position text in a header or footer. Feel free to suggest one.

Hope this helps...