(PECL imagick 2.0.0)

Imagick::setOptionConfigure une option d'un objet Imagick


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

Configure une ou plusieurs options de l'objet Imagick.

Liste de param├Ętres



Valeurs de retour

Returns TRUE on success.

add a note add a note

User Contributed Notes 1 note

alexandre at gaigalas dot net
3 years 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:

= new Imagick();
$handler->setOption('pdf:use-cropbox', 'true');
$handler->thumbnailImage(200, 200, true);

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.
To Top