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

前端 未结 3 390
[愿得一人]
[愿得一人] 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 01:49

    Don't use ImageMagick, use Ghostscript. ImageMagick calls Ghostscript to do the work anyway...

    gs -sDEVICE=jpeg -sOutputFile= -dLastPage=1 
    

    You can also change the device to jpegcmyk (for CMYK output) or jpeggray for gray output, you can change the resolution using -r, use -dFirstPage and -dLastPage to extract a continuous range of pages, etc.

提交回复
热议问题