mergeDocx

mergeDocx

ADVANCED / PREMIUM BASIC

Merges Word documents.

Description
public void mergeDocx(ArrayList documents, String target) throws Exception
public void mergeDocx(ArrayList documents, String target, Integer mergeType, Boolean enforceSectionPageBreak) throws Exception
public void mergeDocx(ArrayList documents, String target, Integer mergeType, Boolean enforceSectionPageBreak, String numbering) throws Exception
public void mergeDocx(ArrayList documents, String target, Integer mergeType, Boolean enforceSectionPageBreak, String numbering, Integer lineBreaks) throws Exception
public void mergeDocx(ArrayList documents, String target, Integer mergeType, Boolean enforceSectionPageBreak, String numbering, Integer lineBreaks, Boolean preserveStyleDefaults) throws Exception

This method allows the full merging of DOCX documents.

The merging process preserves:

  • styles
  • images
  • charts
  • links and cross-references
  • lists
  • altChunk contents
  • footnotes and endnotes
  • comments
  • OLE objects
  • sections with their corresponding headers and footers (optional)

Parameters

documents

Word documents to merge.

target

The destination path of the merged file.

mergeType

"0", preserves the sections of the merged document with their respective headers and footers. "1", merges the contents at the end of the last section of the first document.

enforceSectionPageBreak

Enforces a page section break between documents even if the first section type of the merged document is of the continuous type.

numbering

The destination path of the merged file.

lineBreaks

Inserts the indicated number of line breaks between the contents of the merging files.

Code samples

Example #1:

The resulting Word document looks like: