Hello,
Recent versions of PHP throws a Warning when trying to use a not initialized variable (previous PHP versions throw a Notice). Please apply the following change that is already included in the current testing version of phpdocx that will be included in the next release of phpdocx, that inits that $descr variable always to hide the warning when using a base64 image:
Edit HTML2WordML.php and after line 1291 in the classic package adds the following line:
$descr = 'image' . uniqid(mt_rand(999, 9999));
Instead of the following lines:
case 'img':
case 'svg':
$this->wordML .= $this->closePreviousTags($depth, $nodo['nodeName']);
if (isset($nodo['attributes']['src']) && strstr($nodo['attributes']['src'], 'base64,')) {
The code to be used after the previous change is the following:
case 'img':
case 'svg':
$this->wordML .= $this->closePreviousTags($depth, $nodo['nodeName']);
$descr = 'image' . uniqid(mt_rand(999, 9999));
if (isset($nodo['attributes']['src']) && strstr($nodo['attributes']['src'], 'base64,')) {
This minor change should avoid that warning when using a base64 image and the newest versions of PHP.
Regards.