mergeDocx

mergeDocx

ADVANCED / PREMIUM BASIC

Merges Word documents.

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

This method allows the full merging of DOCX documents.

The merging process preserves:

  • styles
  • images
  • charts
  • lists
  • footnotes and endnotes
  • comments
  • 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: