Issue with converting PDF pages to images with ImageMagick's convert (and PHP)
- by Joel L
I'm trying to create a small web service to convert PDF files to a series of images.
When I run convert /full/path/to/source.pdf full/path/to/target.jpg when connected to the (shared hosting, Linux) server via ssh, everything works correctly.
When executing the same command through PHP's exec() function, only the first few pages of the PDF file get converted. Sometimes the remaining pages are 0-length jpg files, sometimes they don't appear at all.
Also, the bottom area of the first pages is sometimes black, as if convert stopped half-way on the page.
What could be causing this problem?