Forum


Replies: 3   Views: 709
Footnotes number restart in each sections and problem with different headers when merging docx
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  · 12-03-2021 - 16:27

Hello,

Applying different old and even pages is a document setting (not a section tag). When merging documents with mergeDOCX, the first DOCX is the document that sets the document settings to be used in the new DOCX output.
So the different old and even pages option needs to be included in the first DOCX, enabling it if you are using a DOCX template or setting it dynamically:

$A = new CreateDocx();
$A->addText('FIRST');
$customSettings = array(
    'customSetting' => array(
        'tag' => 'evenAndOddHeaders',
        'values' => array('w:val' => '1'),
    )
);
$A->docxSettings($customSettings);
$A->createDocx('A.docx');

Or you can enable it in the DOCX output after merging the documents:

$docx = new CreateDocxFromTemplate('OUTPUT.docx');

$customSettings = array(
    'customSetting' => array(
        'tag' => 'evenAndOddHeaders',
        'values' => array('w:val' => '1'),
    )
);
$docx->docxSettings($customSettings);
$docx->createDocx('OUTPUT_2.docx');

About footnotes number restarting, it's a section property that is not supported in the current version of phpdocx. We have opened a task to include support in the next release of phpdocx.

Regards.