我不能在同一页上同时拥有个性化页脚和页眉

I can't have both personnalized footer and header on same page

我正在创建一个将使用 LibreOffice 打开的 docx 文件,但我在同一页面上显示页眉和页脚时遇到了一些问题

当我同时添加要显示的页眉和页脚时,第一页上只显示一个,然后我得到一个空白页面,然后我的页面上下文在第二页上同时显示页眉和页脚。如果我将页脚放在页眉之前,它将成为每页上的页脚,如果我将页眉放在页脚之前,则相同

$phpWord = new \PhpOffice\PhpWord\PhpWord();

$section = $phpWord->createSection();
$footer = $section->createFooter(array('align'=>'center'));
$footer->addPreserveText('POSTAL ADRESS some text ');
$footer->addPreserveText('STANDARD - tel:  - fax: ');
$footer->addPreserveText("Page {PAGE} of {NUMPAGES}.");


$section = $phpWord->createSection();
$header = $section->createHeader();
$header->addImage(
    'image.png',
    array(
        'width' => 150,
        'height'=> 75,
        'marginTop'=>500,
        'marginLeft'=>400000,
        'align'=>'center',

    )
);

我希望在一个页面上同时显示页眉和页脚。

我刚刚删除了页脚创建下的部分创建,它解决了我的问题,我的问题是它们 "share" 相同类型的部分。