I'm using docx4j to fill out mergefields in a template document. Unfortunately, the merge process seems to lose a lot of formatting (whether or not the
- Code: Select all
\* Mergefield
switch is set). In particular, it always loses text alignment information. This matters, because I want to be able to set the title dynamically.
This is a (decrufted) version of the code I am using:
import org.docx4j.model.fields.merge.MailMerger;
InputStream body; // assigned elsewhere
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(body);
//mail ...