Convert PDF to JPG image with PHP

前端 未结 5 1649
时光说笑
时光说笑 2020-12-18 09:40

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

5条回答
  •  北海茫月
    2020-12-18 09:53

    Use the absolute path to the binary, like this:

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

    But make sure your convert binary is actually on /usr/bin you can check that out with the following command:

    which convert

提交回复
热议问题