Create an A4 PDF using Imagemagick Linux convert command line

this will resize and center a bunch of images into a nice PDF with all the pages the same size:

convert *.jpg -compress jpeg -resize 1240×1753 -extent 1240×1753 -gravity center  -units PixelsPerInch -density 300×300 output.pdf