Forum


Replies: 3   Views: 3305
Retrieve size of template image
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 30-11-2016 - 12:19

Hello,

The current version of phpdocx don't include a method to get that information from Word. We have added a task to include support in the next release of phpdocx for the Indexer class.

Although it can't be done using a method from phpdocx using the current version of the library, it could be done parsing the XML manually:

The size of an image is set by two tags:

<wp:extent cx="914400" cy="914400"/> image size

<wp:effectExtent b="0" l="0" r="0" t="0"/> effects of the image

The cx and cy values are EMUs:

EMUs are used for coordinates in vector-based drawings and embedded pictures. The EMU is a virtual unit to bridge both centimeters and inches. One inch equates to 914400 EMUs and a centimeter is 360000.
(https://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/)

Regards.