Forum


Replies: 5   Views: 4126
Image quality when pulled into word template
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  · 18-09-2015 - 09:26

Hello, Please try setting the dpi parameter when adding the image. Phpdocx use a default dpi of 96 if it can't detect automatically it. Regards.

Posted by i-cre8  · 18-09-2015 - 15:32

ok, could you give me some guidance on how to modify this code please to include that option $docx->addTemplateImage("storelogosm_$count2", $_POST['model'][$count1]?'../../_plugins/site-pages/public/client-pages/dealer-logos/'.$clientLogosm:'../../_plugins/site-pages/public/client-pages/dealer-logos/small_blank.jpg'); Thanks

Posted by i-cre8  · 18-09-2015 - 22:17

ok, so this seems to work $options = array('dpi' => 300); $docx->addTemplateImage("storelogosm_$count1", $db[$count2]['brand']?'../../_plugins/site-pages/public/client-pages/dealer-logos/'.$clientLogosm:'../../_plugins/site-pages/public/client-pages/dealer-logos/small_blank.jpg', $options); one question though if the image being pulled in is not 300DPI what if any are the consequences ? Thanks

Posted by admin  · 21-09-2015 - 14:02

Hello, It depens on each image, we recommend you to do some tests with your images. Phpdocx detects automatically the dpi, but some specific images may fail and you need to set this parameter manually. Regards.

Posted by i-cre8  · 21-09-2015 - 14:52

ok, thanks I will try on a few different images we use