For discussion of FOP's memory usage, see
http://xmlgraphics.apache.org/fop/1.1/r ... tml#memoryOne of these tips is to use multiple page sequences. Docx4j will start a new page sequence each time a sectPr of type other than 'continuous' is encountered in the docx. So if you have manual page breaks, there's a good place to start a new section (next page) .
http://apache-fop.1065347.n5.nabble.com ... 30934.html is also quite interesting.
docx4j's conversion code contains:
Using java Syntax Highlighting
if (saveFO
!= null || log.
isDebugEnabled()) {
ByteArrayOutputStream intermediate
= new ByteArrayOutputStream();
Result intermediateResult
= new StreamResult
(intermediate
);
XmlUtils.
transform(domDoc, xslt, settings.
getSettings(), intermediateResult
);
String fo
= intermediate.
toString("UTF-8");
log.
debug(fo
);
if (saveFO
!= null) {
FileUtils.
writeStringToFile(saveFO, fo,
"UTF-8");
log.
info("Saved " + saveFO.
getPath());
}
Source src
= new StreamSource
(new StringReader(fo
));
Transformer transformer
= XmlUtils.
getTransformerFactory().
newTransformer();
transformer.
transform(src, result
);
} else {
XmlUtils.
transform(domDoc, xslt, settings.
getSettings(), result
);
}
Parsed in 0.016 seconds, using
GeSHi 1.0.8.4
So, for debugging, you can have saveFO or debug enabled, but for production, you don't want that.