Forum


Replies: 2   Views: 2255
Image sized at 127 dpi?
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  · 27-03-2019 - 08:28

Hello,

Images are not forced to 127 dpi. Using embedHTML, the image size is calculated using getimagesize from PHP or width/height properties/styles if set. The final size is calculated from the previous values multiplicated by 7200 EMUs (on https://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/ you can read more information about EMUs). For further information, in the file HTML2WordML.php you can read the internal method used to calculate image sizes: getImageDimensions method.

We recommend you to normalize all images (resolution) and apply width/height sizes based on the needed output. Or use the addImage method that includes more options (height, width, dpi, scaling...). You can also add text placeholders in your HTML to set the image locations and then replace them by images as WordFragments created with addImage.

Regards.