Forum


Replies: 4   Views: 3912
Links in header and footer
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 Choura  · 15-10-2014 - 09:25

Hello, I'm trying to add a link to the body, the header and ther footer with this code : include('phpdocx/classes/CreateDocx.inc'); $link = '< a href = " http://www.google.fr " > http://www.google.fr < / a >'; $docx = new CreateDocx(); $docx->embedHTML($link, array("downloadImages" => true)); $header = new WordFragment($docx, 'defaultHeader'); $header->embedHTML($link, array("downloadImages" => true)); $docx->addHeader(array('default' => $header)); $footer = new WordFragment($docx, 'defaultFooter'); $footer->embedHTML($link, array("downloadImages" => true)); $docx->addFooter(array('default' => $footer)); $docx->createDocx('test'); I obtain a word document wich has an error in the header and the footer. However it opens in "compatibility mode" and only the link in the body works. "Links" in header and footer are just blue underlined texts. I checked the word hyperlink tag inside the code and all 3 are exactly the same. I use the 4.0 version of phpdocx. Can anybody help me plz ?