Forum


Replies: 1   Views: 3305
Issue with header/footer when using templates
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 nicolasattard  · 07-08-2013 - 14:02

Hi there,



When I'm not using a template,  I can set my header like (with an image included) : 



$headerImage = $docx->addImage(array('name' => $pathImage, 'dpi' => 300, 'rawWordML' => true, 'target' => 'defaultHeader'));



$myImage = $docx->createWordMLFragment(array($headerImage));



$docx->addHeader(array('default' => $myImage));



 



And when I add my Template using  $docx->addTemplate ... it does not work anymore. Even if I don't replace any variables. Do you have any suggestion on how can I use addHeader and addFooter also using enableComaptibilityMode in ordre to get Headers&Footers on my pdf ? 



Thanks,



Nicolas



 



Details : i'm using the last version *I guess* of PhpDocx downloaded and installed last week.