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.
Edited by Choura ·
15-10-2014 - 09:44 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 ?Hello,
What license of phpdocx are you using?
Regards.
Hello,
I have a Corporate license.
Hello,
Please open CreateDocx.inc and remove this line (6163):
$this->_relsHeaderFooterLink[$options['target']][] = array('rId' => $key, 'url' => $value);
and add this one:
CreateDocx::$_relsHeaderFooterLink[$options['target']][] = array('rId' => $key, 'url' => $value);
and try again. We're doing some tests to upload a new package with this fix included.
Regards.