解决方法
似乎
ImageMagick understands PDF’s和
Imagick::identifyImage()
返回一个包含大量信息的数组.
这个片段:
$img = new Imagick('test.pdf'); var_dump($img->identifyImage());
生成此渲染:
array(9) { ["imageName"]=> string(9) "/test.pdf" ["format"]=> string(30) "PDF (Portable Document Format)" ["geometry"]=> array(2) { ["width"]=> int(596) ["height"]=> int(843) } ["resolution"]=> array(2) { ["x"]=> float(72) ["y"]=> float(72) } ["units"]=> string(9) "Undefined" ["type"]=> string(14) "TrueColorMatte" ["colorSpace"]=> string(3) "RGB" ["compression"]=> string(9) "Undefined" ["fileSize"]=> string(7) "37.6KBB" }