Concatenate multiple PDF files into one PDF file

For this purpose we need ghostscript, but basically this software comes pre-installed in most linux distribution.

So to concatenate multiple PDFs (file1.pdf, file2.pdf, file3.pdf), into one file (output.pdf), simply run this:

$ gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf file1pdf file2.pdf file3.pdf

Yes, it’s a long command, I know. To change the output paper size we can replace “a4” with “legal” for US Legal or “letter” for US Letter.

Advertisements
Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: