Forum


Replies: 16   Views: 4357
Header and footer not showing
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 Simco uwkm  · 19-12-2017 - 14:35

$headerImageOptions = array(
        'src' => __DIR__ . '/../../Resources/Public/Images/simco_header.png', 
        'dpi' => 300,  
);
$footerImageOptions = array(
        'src' => __DIR__ . '/../../Resources/Public/Images/simco_footer.png', 
        'dpi' => 300,  
);
$headerImage = new \Phpdocx\Elements\WordFragment($docx, 'defaultHeader');
$headerImage->addImage($headerImageOptions);

$footerImage = new \Phpdocx\Elements\WordFragment($docx, 'defaultFooter');
$footerImage->addImage($footerImageOptions);

$docx->addHeader(array('default' => $headerImage));
$docx->addFooter(array('default' => $footerImage));

it's not showing  there as image, but as red cross with message that probably it has not enough memory to display it there or the image was damaged.

how can it be fixed ?