I would like to know, how can i reuse one template (with one page inside and some variables) multiple times a XWPFDocument
object.
My idea is:
- load the template once in a
XWPFDocument
as an template-object - clone/create/copy the template-object with all his styles and headers etc
- fill the clone with content
- add this clone to the destination-
XWPFDocument
I got this work for one single page only. When i try to clone/create/copy the template-object it will lose all his style informations.
How to copy a paragraph of .docx to another .docx withJava and retain the style
How to copy some content in one .docx to another .docx , using POI without losing format?