Forum


Replies: 6   Views: 4385
Add embed html image to header not working
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-10-2015 - 06:38

Hello,

The problem is that you're not setting the correct scope when you instanciate the WordFragment class to add the image. For example:

$headerImage = new WordFragment($docx, 'defaultHeader');

In your code $header has the scope, but for example $headerLeft (among others) doesn't have it.

Please check the included example LayoutAndGeneral/addHeader/sample_2.php. This example example adds an image, a text and a pager to the header and it works perfectly.

Regards.