Stitching together multiple PDFs with ghostscript

Feb 26, '03 09:57:00AM

Contributed by: shucks

I needed a quick and dirty way to stitch PDF together and going through the web and through macosxhints, I found some ways but all seemed to be either too complicated or required downloading lots of stuff. I found a solution here, though, that's quite simple (assuming you have fink installed). Basically what you need to do is issue:

 % fink install ghostscript6
and then (after issuing a rehash):
 % gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
   -sOutputFile=output.pdf pdf1.pdf pdf2.pdf
The command above (it's one line, as shown by the \) will basically create one outputfile called output.pdf that consists of pdf1.pdf and pdf2.pdf. You can replace pdf1.pdf with *.pdf and it will grab all the pdf files and output one pdf. That's all.

[robg adds: I haven't tested this one...]

Comments (19)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030223192653618