Thursday, June 21, 2012

Merge many PDF files into one in linux shell

Do you want to merge many PDF files into one? There you are:

Shell code:
$ gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf

- out.pdf - destination file name
- in1.pdf, in2.pdf - source file names

(gs - Ghost Script - on Ubuntu 12.04 and OpenSuse 11.3 is installed by default)

2 comments:

Unknown said...

Excellent! Piękna komenda :)

Unknown said...

wielkie dzięki za podpowiedź, na swoje potrzeby trochę zmodyfikowałem (...-sOutput=out.pdf str*.pdf) i z 200 plików (str123.pdf) robi mi książkę ;-)