Sunday, May 31, 2015

Combine png / jpg into pdf on windows from the command line for free.

There seems to be a hell of a lot of utilities to combine images (png's, jpgs etc) to form pdfs. But as a savvy user you've probably formed a distrust of shareware or similar.

If you're like me, you've installed a few to find you need to register to get the features you need! Frustrating!

Fortunately it's ridiculously easy with GraphicsMagick, an open source command line image manipulation power house (for free)!

  1. Install GraphicsMagick, doing so via chocolately is the easiest using cinst graphicsmagick from an admin command prompt (if you're not using chocolatey - you should!)
  2. Open a command prompt in the directory where your images are in
  3. gm convert *.png yournewpdf.pdf where *.png can be another image format or a list of images

If "gm" isn't working, try opening a new command prompt to allow the path to be refreshed.

No comments: