Forum


Replies: 9   Views: 5028
List & table fonts change after merging
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 admin  · 19-03-2016 - 20:02

Hello,

The recommended method to merge docx is the MultiMerge class:

http://www.phpdocx.com/api-documentation/docxutilities/merge-Word-documents-with-PHP

The addExternalMethod uses altChunk tags and doesn't preserve most of the styles of the document.

Please try this code:

require_once 'classes/MultiMerge.inc';
$merge = new MultiMerge();
$merge->mergeDocx(
    'file1.docx', 
    array('file2.docx'), 
    'output.docx', 
    array(
        'mergeType' => 0,
        'numbering' => 'restart',
        'forceLatestStyles' => true,
    )
);

If you still have issues please send to contact[at]phpdocx.com the documents you're trying to merge to check them.

Regards.