Saturday, February 6, 2010

Concatenating pdf files

Very frequently, i have to scan documents for my family. I do it using xsane, yet i always end up with many separate pdf files, one for each page of the document. A simple and sweet way to concatenate pdf files (assuming they are sequentially named, eg. 01.pdf, 02.pdf, etc) is:

for f in `ls *.pdf` ; do pdf2ps $f ; done
cat `ls *.ps` > final.ps
ps2pdf final.ps

Yeah !!

Labels