Forum


Replies: 4   Views: 2459
How to replace a placeholder image by another image and keep second image proportions
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-10-2017 - 10:39

Hello,

Yes, you can use the sizes from the existing image or use the size from the new image.

This is the phpdoc of the size options of the method:

* 'width' (mixed): the value in cm (float) or 'auto' (use image size), 0 to not change the previous size
* 'height' (mixed): the value in cm (float) or 'auto' (use image size), 0 to not change the previous size
* 'dpi' (int): dots per inch. This parameter is only taken into account if width or height are set to auto.

You can set width and height values as 0 to keep the previous sizes or set new values (fixed or auto). Please note that if the images doesn't have the same dpi you may need to set a dpi.

Regards.