JSON API - mergeDocx

mergeDocx

PREMIUM TRIAL / ADVANCED

Merges Word documents.

Note

You are reading the JSON API documentation. For the PHP API method please go to mergeDocx.

JSON data
Key Description
document First Word document to merge. Path to the local document, Base64 string, or URL.
documents Array of Word documents to merge with the first document. Each item can be a path to a local document, a Base64 string, or a URL.
mergeType

The possible values are:

  • 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.

If the mergeType equals 1 or the last section of the first document is of the "continuous" type, there may be some missalignment of absolutely positioned content in the merged document. This is due to the fact that the absolute positioned content of the second document was layed out with respect the second document page distribution that may change after the merging.

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 possible values are:

  • continue (the page numbering continues in the merged document).
  • restart (the original page numbering of the second document is preserved).

lineBreaks Inserts the indicated number of line breaks between the contents of the merging files.
forceLatestStyles Keeps the last merged document styles, overwriting the previous styles.
importEmbeddedFonts If true, imports embedded fonts. Default as false.
renameStyles If true, rename styles of the DOCX to be merged with unique names to keep them. Default as false.
Code samples

Example #1

A document can be a local file, a Base64 string, or a remote file.

Release notes
  • phpdocx 18.0:
    • new action.