Hi Everyone,
I am trying to add footer using embedded html.
Below is the code i am trying but it's not working let me know what i am doing wrong here
$docx = new \Phpdocx\Create\CreateDocxFromTemplate($tempFilePath);
$docx->removeFooters();
$docs = new \Phpdocx\Create\CreateDocx();
$htmlFooter = '<footer>
<div class="footer">
<table border="1" style="border-collapse: collapse" width="600">
<tbody>
<tr width="600">
<td>Cell A</td>
<td><img src="image.png" width="35" height="35" style="vertical-align: -15px" data-textAlign="left"></td>
<td><phpdocx_pagenumber data-target="defaultFooter" data-type="page-of" data-textAlign="right" /></td>
</tr>
</tbody>
</table>
</div>
</footer>';
$footerFragment = new \Phpdocx\Elements\WordFragment($docs, 'defaultFooter');
// $footerFragment->embedHTML($htmlFooter);
$footerFragment->embedHTML($htmlFooter, array('useHTMLExtended' => true));
$docs->addFooter(array('default' => $footerFragment));
$docs->createDocx($tempFilePath);
Thanks