I have a paragraph of text which I would like to appear in the center of the document. How can I do this in docx4j? I am currently using:
PPr paragraphProperties = factory.createPPr();
//creating the alignment
TextAlignment align = new TextAlignment();
align.setVal("center");
paragraphProperties.setTextAlignment(align);
//centering the paragraph
paragraph.setPPr(paragraphProperties);
but it isn't working.