Always hacking at something, rabbitear's thoughts and notes about free software, computer security, and the random.

About Me bLog Resume' tHe sHacK! My GitHub

Scanned in jpg's converted to one pdf file.

08 Oct 2012

Simple method for taking a bunch of scanned in jpeg files and making one paged pdf file.

for i in $(ls ~/Directory/*.jpg); do convert -verbose $i $(basename ${i%.jpg}).pdf ; done;

The above converts all jpegs into individual pdf pages.  Convert will connect them together for you, but unless you have a huge amount of memory it will fail.

pdftk *.pdf cat output newdoc.pdf

The above here combines all of the pdf pages into one document.  Instead of using wildcard you could take the time to arrange the pages as you see fit.