Search code examples
phppdfimagick

Imagick fails to get pdf


I have this part of code :

$im = new Imagick( $pdf_file );
            $im->setImageFormat( "png" );
            $im->scaleImage( 100, 100, true );

but i get the following error: unable to open image on Imagick->__construct('/home/server/...')

The pdf file is 8MB in size, but if i put a pdf that has 3 or 4 MB in size it works. Is there a way to make Imagick to take files with bigger size?

Thank you.


Solution

  • Could be your memory_limit is lower than 8MB. Check it with

    var_dump(ini_get('memory_limit'));

    You'll also be able to set this outside of php.ini

    ini_set('memory_limit', '8M');