My goal is to extract about 30 JPG or PNG images from a PDF using PHP. I’m using ImageMagick from PHP in a shared hosting. Imagick::readImage. (PECL imagick ). Imagick::readImage — Reads image from filename. Description. bool Imagick::readImage (string $filename). Example case: extract page 1 of a pdf file and save it as jpg image. $i = new Imagick(); $i->setResolution();.
|Published (Last):||17 February 2009|
|PDF File Size:||9.92 Mb|
|ePub File Size:||3.42 Mb|
|Price:||Free* [*Free Regsitration Required]|
Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? I’m using ImageMagick 6.
I have tried several source PDFs having from 20 to 30 images each. It always works fine for the first 10 images, but starting at index X and thereafter it always gets an exception.
php – Imagick – Can’t read image files from URL. – Stack Overflow
I tried the same test on another hosting account with PHP 7. It always gives an exception readomage the readImage command when index is around 15 or higher depending on the source PDF.
readiamge Each page is essentially a big image. The code above works for the first X pages, then fails with an exception. I’m trying to extract pages 0 to It seems that when you are reading a page that is far enough into the PDF file, it gets the exception.
The first page readimate  and you are requesting page  which would be the 16 page. The Imagemagick developers have nothing to do with Imagick.
Does it work with a simple convert command line? Select all convert bound.
If it still fails try reading 5 pages at a time which will hopefully isolate the problem. ImageMagick examples mostly using php Imagick examples.
PHP и PHP 7 на русском: Функция Imagick::readImage() – Reads image from filename
They all fail on the readImage[X] command. Bear in mind this is readimqge in PHP from a shared hosting account so I do not have a Command line environment to run a convert command. To clarify, the entire script consists of only two lines. It is not running a loop and finally getting the exception on the 16th page.
Do you have access to PHP execso that you could run the command line and see if that fails?