Replies: 2   Views: 123
The open xml file xxx.docx cannot be opened

Posted by admin  · 08-08-2019 - 08:35

The problem is that the document is using float values to set image sizes:
<wp:extent cx="4506235.2" cy="3117578.4"/>

<a:ext cx="4506235.2" cy="3117578.4"/>

And MS Word doesn't support them, you need to use positive integers.
phpdocx 9.5 will add an integer cast when adding images from HTML. If you want to apply the same change, you need to edit HTML2WordML.php and in the method getImageDimensions remove the return line and use:
return array((int)$cx, (int)$cy);