Replies: 4   Views: 3644
Mergedocx() breaks when merging a document with a long table
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 darren77  · 06-02-2013 - 16:38

I am trying to merge 2 documents: the first one is just an introduction text, the second one is a table which is almost as long as the whole page.

The merging document should get:
[list]introduction text
the first part of the table
a page break
the second part of the table [/list]

What I get is:

[list]the first part of the table
empty lines
introduction text
empty lines
a page break
the second part of the table[/list]

I am testing it using the following code:

[code]$newDocx = new DocxUtilities();
$options = array('mergeType' => 0);
$newDocx -> mergeDocx(TEMP_PATH . 'section_4_intro' . EXT, //intro
TEMP_PATH . 'section_4_table' . EXT, //table
TEMP_PATH . 'section_4_merged' . EXT, //final

I tried both mergeType 1 and 0

I can PM the word files if you wish