Hi to all,
I want to merge some file docx into a new one. These files may contains images.
This is my code.
File first = new File("C:\\...\\...\\main.docx");
File second = new File("C:\\...\\...\\attach_1.docx");
File third = new File("C:\\...\\...\\attach_2.docx");
File fourth = new File("C:\\...\\...\\attach_3.docx");
try
{
WordprocessingMLPackage cdu = WordprocessingMLPackage.load(new FileInputStream(first));
org.docx4j.wml.P p = new org.docx4j.wml.P();
org.docx4j.wml.R r = new org.docx4j.wml.R();
org.docx4j.wml.Br br = new org.docx4j.wml.Br();
br.setType(STBrType.PAGE);
r.getContent().add(br);
p.getContent().add(r);
cdu.getMainDocumentPart().addObject(p);
List<WordprocessingMLPackage> attachmentList = new ArrayList<WordprocessingMLPackage>();
attachmentList.add(WordprocessingMLPackage.load(new ...