command line multiple pnm conversion to single pdf file

Problem

You have multiple scanned images as pnm files, and you would like to convert them to a single pdf file.

 

Solution

If you have imagemagick installed you should be able to use the convert as follows to combine the images to one pdf file: