$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 ?