Page 1 of 1

Distributed Paragraph Alignment

PostPosted: Thu Sep 15, 2011 12:43 pm
by mpfa_cs
When the docx document contains the "distributed" paragraph alignment, the output document it produces cannot be opened by Word. Having traced the XML a bit, we found that the attribute of the <w:jc> tag, which was originally present in the template, was removed by docx4j after processing.

We are using docx4j 2.7.0 and Microsoft Word 2007. Attached are the template file and the output file.

Here is the code:
public class Test {

private static final String TEMPLATE_FILE_NAME = "/TestJC/template.docx";
private static final String OUTPUT_FILE = "/TestJC/output.docx";

/**
* @param args
* @throws Docx4JException
*/
public static void main(String[] args) throws Docx4JException {
WordprocessingMLPackage wmlPackage = WordprocessingMLPackage.load(new File(TEMPLATE_FILE_NAME));
SaveToZipFile file = new SaveToZipFile(wmlPackage);
file.save(OUTPUT_FILE);
}
}

The <w:jc> tag's attribute has been removed by Docx4J.
<w:jc w:val="distribute"/> --> <w:jc/>

Is this a bug?

Re: Distributed Paragraph Alignment

PostPosted: Fri Sep 16, 2011 7:12 am
by jason
Hi, yes, this looks like a bug.

I'll fix it next week.

cheers .. Jason

Re: Distributed Paragraph Alignment

PostPosted: Fri Sep 16, 2011 8:52 pm
by mpfa_cs
Jason,

Thanks and waiting for your reply.

Re: Distributed Paragraph Alignment

PostPosted: Tue Sep 20, 2011 9:37 am
by jason

Re: Distributed Paragraph Alignment

PostPosted: Wed Sep 21, 2011 9:40 pm
by mpfa_cs
Works perfect. Thanks for you help.