tony2 tony2 - 1 month ago 5x
PHP Question

Convert PDF to JPG image with PHP

I am using ImageMagik to try and convert the contents of a PDF to JPG, but keep getting an empty jpg. I have made sure the perms are 777 on everything for testing so I am a little lost how to continue.

Here is the script I am running


exec('convert testfile.pdf output.jpg', $output, $return_var);



Try this.

    $pdf = 'testfile.pdf';
    $save = 'output.jpg';

    exec('convert "'.$pdf.'" -colorspace RGB -resize 800 "'.$save.'"', $output, $return_var);