Concatenating a PDF and a bunch of JPGs

Someone here at work wanted to know how to add a three-page PDF to a Word document, and then add a dozen photos after it, and then save the whole mess as a new PDF.

I suggested ImageMagick’s convert and pdftk.

  1. Combine all the images into one PDF:
     $ convert *.jpg photos.pdf 
  2. Put the two PDFs together:
     $ pdftk report.pdf photos.pdf cat output report\_with\_photos.pdf 

And that’s it.

(Of course, when one suggests this sort of thing to someone who wants to use Word, one invariable ends up doing it for them. Which is why I’ve posted this here, so in six months when I’m asked again, I’ll remember how to do it.)

External links:

Skala, M. 2008. How to concatenate PDFs without pain.