There appears to be a bug with having an image with a float attribute when using replaceVariableByHTML The following code always produces a corrupt .docx - at least when trying to open the output in Word 2007 (I know).
$docx=new CreateDocxFromTemplate("../tmp/Test.docx",array('parseMode'=>true));
$docx->setTemplateSymbol('|');
$html="<p><img src='../tmp/test.jpg' style='float:right;' alt='img_qrcode'>Testing floating image<br>line 1<br>line 2<br>line 3<br>line 4<br>line 5<br>line 6<br></p>";
$docx->replaceVariableByHTML('iHowtovote','block',$html, array('isFile' => false,'parseFloats' => true, 'downloadImages' => true));
$docx->createDocx("../tmp/Output.docx");