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

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

    If you are using a convert command line you can execute it with these parameters:

    convert  source.pdf[0]  output.jpeg
    

    Note that the page count of ImageMagick is 0-based. So [0] means 'page 1'. To select, say the 4th page, you'd have to use [3].

    This syntax does not only work for PDF input. It also works with other multi-page or mult-frame formats, such as multi-page TIFF or animated multi-frame GIFs and PNGs.

提交回复
热议问题