Page 1 of 1

"Flattening" .docx Documents

PostPosted: Mon Aug 17, 2015 7:18 am
by mcgullen
Hi Jason: a task on hand requires me to "flatten" styles and other dynamic contents in a .docx documents. For example, formatting applied through styles are expected to be moved to the corresponding <w:rPr> or <w:pPr> as, say, <w:b/>, and a dynamically generated <w:numPr> should be converted to a simple text node (e.g., "4.02"). Is there an example of doing so? If not, could you please kindly point me to the right direction? Thanks!

Re: "Flattening" .docx Documents

PostPosted: Mon Aug 17, 2015 9:30 am
by jason
Have a look at org.docx4j.convert.out.fo.FOExporterVisitorGenerator

Both those things need to be done to generate FO output.

Re: "Flattening" .docx Documents

PostPosted: Tue Aug 18, 2015 3:29 am
by mcgullen
Jason, thanks! The code example is extremely helpful.