2015-09-08 321 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

相關問題