#!/bin/sh # Thanks to Matthew Skala # http://ansuz.sooke.bc.ca/software/pdf-append.php # # Yves Dorfsman, www.SollerS.ca # if [ $# -lt 2 ] || [ -e $1 ] ; then echo '' >&2 echo 'Error: missing arguments, or existing output file.' >&2 echo '' >&2 echo 'Usage: pdfcat concateneted_file.pdf file1.pdf [file2.pdf [...]]' >&2 echo '' >&2 echo 'e.g.: pdfcat newfile.pdf *.pdf' >&2 echo '' >&2 echo '' >&2 exit 1 fi gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$*