I would like to insert an image to my docx with PHPWord and set it as background or send it to back. But the codes that have given in the documents seems not working and have some errors in it. I hope you guys help me in my problem. Thank you!
Here is my sample code regarding my problem with PHPWord.
$templateProcessor = new TemplateProcessor('Template.docx');
$templateProcessor->setImageValue('UserLogo', array('path' => 'images/background.jpg', 'width' => 100, 'height' => 100, 'ratio' => false));
return array('path' => SlowFeatureImageGenerator::make(), 'width' => 100, 'height' => 100, 'ratio' => false);
});
I am new with PHPWord.
>Solution :
I also had the same problem too but I think this will help us here. How to add/set images on PHPOffice/PHPWord Template?