Merge multiple pdf files using Ghostscript command.
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=output.pdf file1.pdf file2.pdf