set density parameter for imagick with php

浪尽此生 提交于 2019-11-30 21:23:18

You need to set Resolution before you read the file.

$im = new imagick();
$im->setResolution(200,200);
$im->readImage(__DIR__ . DIRECTORY_SEPARATOR.$PDFName.'['.$i.']');

Than, the result will be perfect.

Hope this help someone.

dakdad

From the manual http://php.net/manual/en/imagick.setresolution.php

Imagick::setResolution() must be called before loading or creating an image.

See this answer Pdf to image using php-imagick api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!