downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Imagick::setPage> <Imagick::setLastIterator
[edit] Last updated: Fri, 24 May 2013

view this page in

Imagick::setOption

(PECL imagick 2.0.0)

Imagick::setOptionオプションを設定する

説明

bool Imagick::setOption ( string $key , string $value )

ひとつあるいは複数のオプションを設定します。

パラメータ

key

value

返り値

成功した場合に TRUE を返します。



add a note add a note User Contributed Notes Imagick::setOption - [1 notes]
up
0
alexandre at gaigalas dot net
1 year ago
If you want to extract a preview from a PDF file using the CropBox instead of the whole document, setOption() is the right method:

<?php
$handler
= new Imagick();
$handler->setOption('pdf:use-cropbox', 'true');
$handler->readImage($imageFileName);
$handler->thumbnailImage(200, 200, true);
$handler->setImageFormat('jpeg');
$handler->writeImage($destThumbFileName);
?>

It is the equivalent to the -define pdf:use-cropbox=true for the convert command line tool. pdf:use-trimbox is also available.

Note that on my environment the setOption only worked when i called it before the readImage method, which means that you can't pass the filename to the Imagick constructor directly.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites