Convert multiple images into PDF using imagemagick

tips and tricks

This one was quite a time-saver for me and a definite addition to the permanent toolkit.

I’ve happened to have a set of images that I needed to merge into a PDF. Having done it using Preview app on the Mac before, I was looking if a better solution was there. And what an elegant one it was!

It turns out that ImageMagick package has exactly the right tool for the job.

To simplify the execution, I’ve copied all the images to be merged into a single directory and made sure they were properly numbered (for example, all smaller numbers had the correct number of leading zeros).

Then, the command is trivial:

convert prefix*.jpeg document.pdf

No ImageMagick?

The process is slightly longer if you do not have ImageMagick installed:

  1. Install MacPorts
  2. Install ImageMagick
    sudo port install ImageMagick

Credit:
http://stackoverflow.com/questions/8955425/how-can-i-convert-a-series-of-images-to-a-pdf-from-the-command-line-on-linux

blog comments powered by Disqus