开发者

convert: Postscript delegate failed - converting text PDFs

开发者 https://www.devze.com 2023-03-20 05:55 出处:网络
This one has me stumped. I need to convert PDFs into jpgs.I do so using the following commands : $cmd = \"convert \".$upload->pdf_name.\" -geometry 80x80 -density 80x80 -quality 100 \".$upload-&

This one has me stumped.

I need to convert PDFs into jpgs. I do so using the following commands :

$cmd = "convert ".$upload->pdf_name." -geometry 80x80 -density 80x80 -quality 100 ".$upload->thumb_name." 2>&1";
exec($cmd,$results);

$cmd_gif = "convert ".$upload->pdf_name." -geometry 640x640 -density 640x640 -quality 100 ".$upload->gif_name." 2>&1";
exec($cmd_gif,$results);

If I upload a PDF which is mostly image then I have no prob开发者_JS百科lems. I get the thumbnail and preview. If I upload a PDF which is mostly text, and print_r $results I get :

Array([0] => convert: no decode delegate for this image format `/tmp/magick-wSgqd1Vp-00000001' @ error/constitute.c/ReadImage/532. 
[1] => convert: Postscript delegate failed `/var/www/vhosts/site/uploadedfiles/tmp/2_77.pdf': @ error/pdf.c/ReadPDFImage/664. 
[2] => convert: no decode delegate for this image format `/tmp/magick-8foOHRJR' @ error/constitute.c/ReadImage/532. 
[3] => convert: missing an image filename `/var/www/vhosts/site/uploadedfiles/tmp/2_77_thumb.jpg' @ error/convert.c/ConvertImageCommand/3015. 
[4] => convert: no decode delegate for this image format `/tmp/magick-M-zHuvtS-00000001' @ error/constitute.c/ReadImage/532. 
[5] => convert: Postscript delegate failed `/var/www/vhosts/site/uploadedfiles/tmp/2_77.pdf': @ error/pdf.c/ReadPDFImage/664. 
[6] => convert: no decode delegate for this image format `/tmp/magick-rJ8G814k' @ error/constitute.c/ReadImage/532. 
[7] => convert: missing an image filename `/var/www/vhosts/site/uploadedfiles/tmp/2_77.jpg' @ error/convert.c/ConvertImageCommand/3015. )

I have Ghostscript 8.70 installed and imagemagick 6.7.1-0 My linux distro is CentOS release 5.6


Your 2nd command, $cmd_gif, asks ImageMagick to create a picture of dimensions ("geometry") 640x640 pixels, while at the same time asking for a resolution ("density") of 640x640...

0

精彩评论

暂无评论...
验证码 换一张
取 消