I’m trying to insert a document into another one by using the DocumentBuilder.insertDocument method. The inserted document has a continuous section break after which a 3-column layout starts. After insertion however the continuous section break is replaced by a page break section break. This destroys the entire document layout.
Please note the attached documents.zip and the following code:
Document document = new Document("input.docx");
DocumentBuilder builder = new DocumentBuilder(document);
builder.moveToDocumentEnd();
Document toInclude = new Document(new FileInputStream(new File("document_to_include.docx")));
builder.insertDocument(toInclude, ImportFormatMode.USE_DESTINATION_STYLES);
document.save("output.docx");
documents.zip (27.5 KB)