Merge multiple jpg into single pdf in Linux

后端 未结 6 1849
南旧
南旧 2021-01-30 02:25

I used the following command to convert and merge all the jpg files in a directory to a single pdf file.

convert *.jpg file.pdf

Th

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-30 02:57

    You could use

    convert '%d.jpg[1-132]' file.pdf
    

    via https://www.imagemagick.org/script/command-line-processing.php:

    Another method of referring to other image files is by embedding a formatting character in the filename with a scene range. Consider the filename image-%d.jpg[1-5]. The command

    magick image-%d.jpg[1-5] causes ImageMagick to attempt to read images with these filenames:

    image-1.jpg image-2.jpg image-3.jpg image-4.jpg image-5.jpg

    See also https://www.imagemagick.org/script/convert.php

提交回复
热议问题