Forum


Replies: 4   Views: 3435
Header
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 nirzarit  · 21-08-2012 - 04:50

hi there,

How would i add an image in header and footer?
i have tried following example but it didn't work.it generates the word file without image in header.

require_once '../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$paramsHeader = array(
'name' => '../files/img/image.png',
'jc' => 'right',
'font' => 'Arial'
);
$docx->addHeader('Header Arial', $paramsHeader);
$paramsHeader = array(
'font' => 'Times New Roman'
);
$docx->addHeader('Header Times New Roman', $paramsHeader);
$paramsFooter = array(
'pager' => 'true',
'pagerAlignment' => 'center',
'font' => 'Arial'
);
$docx->addFooter('Footer Arial', $paramsFooter);
$paramsFooter = array(
'font' => 'Times New Roman'
);
$docx->addFooter('Footer Times New Roman', $paramsFooter);
$docx->createDocx('../docx/example_header_and_footer');

Please HELP!!!

Thanks