Use imagemagic to put several JPG on one page

imagemagick

I have a folder full of jpg files. When I use the following command,

convert *.jpg assembly.pdf

I get a pdf file with one image per page of the pdf. I would like to put 9 images on each page. Is there a way to do this with convert or mogrify?

Alternatively, I'd like to combine 9 of the jpg images into one jpg image so that I can convert that into a PDF.

Thanks,

z.

Best Answer

You're looking for montage from ImageMagick :

NAME
       montage  - create a composite image by combining several sepa‐
       rate images. The images  are  tiled  on  the  composite  image
       optionally adorned with a border, frame, image name, and more.

If you already have convert then you almost certainly also have montage. To get a grid of 3x3 images per page on your pdf try this:

 montage *.jpg -tile 3x3 assembly.pdf

This assumes your images all have roughly the same size. Have a read through the documentation for more complex options.

Related Question