It turns out that from Tiger onwards, OSX ships with a Python script
that does exactly what you need. The script is already executable, and
Python is pre-installed on OS X, so all you need to do to run it is
opening the Terminal and typing
"/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o PATH/TO/YOUR/MERGED/FILE.pdf /PATH/TO/ORIGINAL/1.pdf /PATH/TO/ANOTHER/2.pdf /PATH/TO/A/WHOLE/DIR/*.pdf
Also on the linked page it suggests making a symbolic link for the join.py file to make typing easier however they omitted the -s in ln -s ... ..., and without it, a hard link is created. Probably wouldn't matter, however though I'd mention it.
PDFCombo, new free app for Mac OS X, combines PDFs and preserves the table of contents. It can also add a TOC entry based on filename to link to first page of every contributing PDF in the combined PDF.
Best Answer
Have a look at "Combining PDF files on the command line in OSX" in Joining PDF Files in OS X From the Command Line.
Also on the linked page it suggests making a symbolic link for the
join.py
file to make typing easier however they omitted the-s
inln -s ... ...
, and without it, a hard link is created. Probably wouldn't matter, however though I'd mention it.