We are using phpdocx 9.5 premium and I think there is an issue with the mergeDocx option enforceSectionPageBreak.
In my case I have a docx document that is used for a bulk letter. So the document has some placeholders that are replaced by phpdocx and at the end all the documents are merged to one.
$merge = new MultiMerge(); $first_document = array_shift($files); $merge_options = [ 'mergeType' => 0, 'numbering' => 'restart', 'preserveStyleDefaults' => true, 'forceLatestStyles' => false, 'enforceSectionPageBreak' => true, 'lineBreaks' => 1 ]; $merge->mergeDocx($first_document, $files, $filename, $merge_options);
But in the result document the text of the second document floats into the first document.
As a dirty fix I've added a section page break at the end of the document. So it has a blank last page.
With that fix the merge works correctly. The second document starts on the blank page of document one, the third document starts on the blank page of document two and so on. But at the end of the merged document there is a blank page because of my added section page break. So I need the enforceSectionPageBreak option to work please :)