Hello,
Is it possible to merge two doc file.
In fact I use the merge variable example, but I would like to merge a document with a list of map.
My idea was to merge docx after docx and then merge the result docx.
Thank's.
When I talk about List of Map, this is not images but Map of variables.
In fact i have a docx file that I use as template and that contains variables ${...}.
Then I'd like to merge my template with several set of variables, for example to print a set of letters or something like that.
I would have an utils method that take as parameters a List of Map (List<HasMap<String, String>>).
And so I'd like to merge the docx files during the Java merge, but I think it's not as simple than merge the doc part.
List <Object> bodyChildren = getBody(wordMLPackage1).getEGBlockLevelElts();
getBody(wordMLPackage2).getEGBlockLevelElts().addAll(bodyChildren);
private Body getBody( WordprocessingMLPackage wordMLPackage ) {
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
org.docx4j.wml.Document wmlDocumentEl = (org.docx4j.wml.Document)documentPart.getJaxbElement();
return wmlDocumentEl.getBody();
}
Users browsing this forum: Google [Bot] and 55 guests