Convert JPG to PDF with ImageMagick

Revision history
Tags: imagemagick convert pdf arch linux

The convert binary is supplied by ImageMagick, so if you haven’t already installed it, do so first. ghostscript is also necessary to create PDF’s.

# pacman -S imagemagick ghostscript

Convert all JPG files in current directory to PDF with .pdf suffix

$ for f in ./*; do convert $f $f.pdf; done

Combine all pictures in a single PDF file

$ convert "*.jpg" combined.pdf

Problems

ImageMagick produces invalid PDF’s

If the resulting PDF’s are corrupted or are otherwise not created as expected, make sure you actually installed ghostscript.

If you have any comments or feedback, please send me an e-mail. (stig at stigok dotcom).

Did you find any typos, incorrect information, or have something to add? Then please propose a change to this post.