How to execute ImageMagick to convert only the first page of the multipage PDF to JPEG?

前端 未结 3 398
[愿得一人]
[愿得一人] 2021-01-31 01:26

How do I execute ImageMagick\'s convert if I want a JPEG from the first page only of a multi-page PDF?

3条回答
  •  春和景丽
    2021-01-31 02:01

    To further the answer by @KenS, Here are a more few details, particularly for Windows users.

    You can download GhostScript for Windows here: http://www.ghostscript.com/download/gsdnld.html. The default installation path for the executable is "C:\Program Files\gs\gs910\bin\gswin64c.exe".

    The command-line arguments listed above are correct in Windows too, but here are a few more that I found useful:

    gswin64c.exe -dNOPAUSE -dBATCH -r96 -sDEVICE=jpeg -sOutputFile=""
                 -dFirstPage=1 -dLastPage=1 ""
    

    I also created a batch file that wraps this up nicely and posted it to my GitHub account. It makes it a lot easier to create thumbnails for multiple .pdf files too. Check it out at pdf2jpg.bat.

提交回复
热议问题