Forum


Replies: 11   Views: 4402
Headers being added in merge
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 ellytronic  · 20-03-2014 - 08:15

Hi there,



I'm trying to merge two files together using the Pro+ version. One file has headers & footers, the other does not. It all works fine if I merge the file without headers and footers as the first file, but if it's added after the file with headers & footers, it inherits those as well. I'm using enforceSectionPageBreaks (on) and mergeType = 0.



$mergeOptions = array(

  'mergeType' => 0, 

  'enforceSectionPageBreak' => true

);

$docxUtil->mergeDocx( $existing_file, $file_to_append, $new_docx_filename, $mergeOptions );



You can see the files on my server:



original with headers   |   original without headers   |   merged file with problem headers (page 2 should have no headers/footers).





I've spent over 10 hours just trying to solve this problem trying various operations on createdocx but I just can't figure this out. Please help!