2015-09-08 632 views
16

我有我需要转换为图像的PDF。我已经安装了Imagemagick。我有一个PDF名为a.pdf我可以在文件夹C打开(这是不是腐败):\转换\Imagemagick将PDF转换为JPEG:FailedToExecuteCommand`“gswin32c.exe”/ PDFDelegateFailed

在命令行中我试图

C:\Convert>convert a.pdf a.jpg 

而且我得到的错误。

convert.exe: FailedToExecuteCommand `"gswin32c.exe" -q -dQUIET -dSAFER -dBATCH - 
dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEV 
ICE=pamcmyk32" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dUseCIEColor 
"-sOutputFile=C:/Users/MNALDO~1.COR/AppData/Local/Temp/magick-3704HYGOqqIK5rhI%d 
" "-fC:/Users//MNALDO~1.COR/AppData/Local/Temp/magick-3704vK6aHo7Ju9WO" "-fC:/Use 
rs//MNALDO~1.COR/AppData/Local/Temp/magick-3704GQSF9kK8WAw6"' (The system cannot 
find the file specified. 
) @ error/delegate.c/ExternalDelegateCommand/480. 
convert.exe: PDFDelegateFailed `The system cannot find the file specified. 
' @ error/pdf.c/ReadPDFImage/797. 
convert.exe: no images defined `a.jpg' @ error/convert.c/ConvertImageCommand/323 
0. 
+1

您需要安装Ghostscript的栅格化矢量文件(如PDF,EPS,PS等)与Imagemagick。 – Crontab

+0

imagemagick convert命令是否正在寻找要安装的映像文件,还是用于执行此转换的备用软件? – MatthewD

+1

两者。 Imagemagick需要它来处理矢量文件光栅化,但它基本上只能用于Ghostscript才能完成。事实上,整个Ghostscript命令行都列在你的问题中(从“gswin32c.exe”开始,到“(系统不能”)结束。) – Crontab

回答

15

你需要为了与ImageMagick的栅格化矢量文件(PDF,EPS,PS等)安装Ghostscript。在进行这些操作时,IM会向Ghostscript发送消息(如果在IM调用中使用-verbose标签,则可以看到它)。你也可以自己使用Ghostscript来光栅化矢量文件。

+0

我安装了ghostscript,它的工作完美。转换命令的选项http://stackoverflow.com/questions/6605006/convert-pdf-to-image-with-high-resolution – MatthewD

+0

有没有办法安装Ghostscript portably?我有一个可移植的ImageMagick安装在一个闪存驱动器,我想也有一个便携的方式将PDF转换为JPG。 – 9a3eedi

13

由于您实际上必须安装Ghostscript来执行此操作,为何不将ImageMagick放在一起?它只是将命令转发给Ghostscript,而不是增加任何值,只是花更长的时间来处理(并将所有内容加载到内存中)。

安装Ghostscript的,然后运行命令:

gswin64c.exe -dNOPAUSE -sDEVICE=jpeg -r200 -dJPEGQ=60 -sOutputFile=foo-%03d.jpg foo.pdf -dBATCH 

这是相同的,并且比运行速度更快:

convert -quality 60 -density 200 foo.pdf foo-%03d.jpg 
+0

该帖子的其他信息。谢谢... – MatthewD

相关问题