Imagemagick Convert PDF to JPEG: FailedToExecuteCommand `“gswin32c.exe” / PDFDelegateFailed

后端 未结 4 2232
执笔经年
执笔经年 2020-12-07 22:59

I have PDFs that I need to convert to images. I have installed Imagemagick. I have a PDF named a.pdf that I can open (it is not corrupt) in the folder C:\\Convert\\

<
4条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 23:31

    Since you actually have to install Ghostscript to do this, why not drop ImageMagick all-together? It just forwards the command to Ghostscript anyway, not adding any value, just taking way longer to process (and loading everything into RAM while its at it).

    Install GhostScript and run the command:

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

    This is identical and faster than running:

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

提交回复
热议问题