I have the following php function below that\'s converting a local PDF file into images. In short, I want each PDF page to be converted to a separate image.
There is a much easier way without the loop, just use $img->writeImages($filename,false); and it will make a file per PDF-page. As you said, if you flatten the image first, it only saves 1 page.