简体   繁体   中英

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.

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');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM