0

When i merge 2 docx that have not tetbox, there is no problem with this code.

public static void merge(XWPFDocument source, XWPFDocument append) throws Exception {   
    CTBody apn = append.getDocument().getBody();
    source.getDocument().addNewBody().set(apn);
}

But if the docx have text boxes, source docx have a problem that is unspecified error.

First error

Second error

How can i merge 2 docx that have textboxs?

Melody
  • 21
  • 2
  • 1
    Merging `Word` documents is much more than simply concatenating body elements. This is a complex programming project and much too broad to be an answer here. See https://stackoverflow.com/questions/60018163/premature-end-of-file-xwpfdocument-to-pdfconverter/60018408#60018408 and https://stackoverflow.com/questions/59799991/where-are-list-informations-stored-in-apachepois-xwpfdocument. – Axel Richter May 14 '20 at 06:51
  • Welcome to Stack Overflow. You will have a better experience here if you take the [tour](https://stackoverflow.com/tour), read through [How do I ask a good question?](https://stackoverflow.com/help/how-to-ask), then write your question with details to [create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example). Regards – eloibm May 14 '20 at 06:53
  • Thank you. So I solved this problem with merging with pdf, not merging with docx. Docx has lots of problem with merging. So I used pdf – Melody Jun 02 '20 at 05:38

0 Answers0