PHP 7.0.6 Released

Imagick::nextImage

(PECL imagick 2.0.0)

Imagick::nextImageMoves to the next image

Description

bool Imagick::nextImage ( void )

Associates the next image in the image list with an Imagick object.

Return Values

Returns TRUE on success.

User Contributed Notes

markus dot s dot schmitz at gmail dot com
3 years ago
Convert PDF to JPG page-wise:

<?php
$i
= 0;

$imagick = new Imagick();
$imagick->readImage('myfile.pdf');
while(
$imagick->hasNextImage()) {
   
$imagick->writeImage(++$i.'-converted.jpg', false);
   
$imagick->nextImage();
}
?>

See also: http://php.net/manual/en/imagick.readimage.php
To Top