When reading a PDF from an ImageBlob, and you want to set the page to be used, this is the function to use.
Imagick::setImageIndex
(PECL imagick 2.0.0)
Imagick::setImageIndex — イテレータの位置を設定する
説明
bool Imagick::setImageIndex
( int
$index
)画像リスト内でのイテレータの位置、index パラメータで指定した場所に設定します。
このメソッドは非推奨です。 Imagick::setIteratorIndex() を参照ください。
パラメータ
-
index -
イテレータを設定する位置。
返り値
成功した場合に TRUE を返します。
エラー / 例外
エラー時に ImagickException をスローします。
Rob Hidalgo ¶
8 months ago
maulik_Vr at yahoo dot co dot in ¶
1 month ago
when you read pdf by getImageBlog and want to get the image or blob of a specific page, use this function as below.
$ims = new Imagick();
$ims->readImageBlob($pdfFileContent);
$ims->setImageIndex(5); //this will return 6th page of the pdf file
$image->setImageFormat('png');
//etc
$blob = $image->getImageBlob();
