Replies: 5   Views: 2589
Merging removes 2 out of 3 section breaks
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by k.barendrecht  · 11-07-2017 - 13:46

I've successfully created three documents from templates: doc-section-0.docxdoc-section-1.docxdoc-section-2.docx. Each of these contains a section with sectionType 'nextPage' at the end of the first page as seen in the screenshots.

After merging with mergeType: 'continuous' (1) only the section from the first document remains. 

// Merge the first file with the remaining files, mergeTypes: 0 = addSectionAtEnd, 1 = continuous
        (new MultiMerge())->mergeDocx(FILE_OUTPUT_LOCATION, $docxSectionFilesPaths, FILE_OUTPUT_LOCATION, ['mergeType' => 1, 'numbering' => 'continue']);

Why is the merge removing 2/3 section breaks, and how do I prevent this from happening?