Forum


Replies: 1   Views: 2060
Image not displaying in footer (only if not added to text array)
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  · 18-08-2019 - 09:34

Hello,

The problem is that you are not adding the defaultFooter scope in the WordFragment and you need to use the main CreateDocx, not other WordFragment:

$footer = new WordFragment($toc, 'defaultFooter');

$footerImage = new WordFragment($toc, 'defaultFooter');
$footerImage->addImage($imageOptions);

$pageNumber = new WordFragment($toc, 'defaultFooter');
$pageNumber->addPageNumber('numerical');

$divider = new WordFragment($toc, 'defaultFooter');
$divider->addText(' | ');

On https://www.phpdocx.com/documentation/practical/wordfragments-and-wordml and the included samples you can read more information about WordFragment scopes.

Regards.