Replies: 4   Views: 3275
Images in headers
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 fortech  · 26-07-2011 - 14:44

I'll trying to place an image in the header. I have:

$header = '';
$paramsImg = array(
'name' => $_SERVER['DOCUMENT_ROOT'].'/img/header.png',
'scaling' => 100,
'spacingTop' => 100,
'spacingBottom' => 0,
'spacingLeft' => 100,
'spacingRight' => 0,
'textWrap' => 1,
'js' => 'center',
'border' => 1,
'borderDiscontinuous' => 1

$docx->addHeader($header, $paramsImg);

I get the image importing fine, however the image has a width of 0" and height of (basically infinite). I've tried the sixeX, sixeY with other combinations, with no change in results. Am I missing a param to make it work? Thanks.