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.
Hi,
We have some logo's that we pull into a word template that are generated at 300DPI (print quality) but when I view the word doc after generation the quality of the image seems to have degraded.
Does the process of inserting them change the image quality ?
I can send the original logo and a copy of the doc
This is using ver 3.3
Thanks
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.
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
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
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.
ok, thanks I will try on a few different images we use