Saugata

Merge pdfs in one line

In Computers on March 18, 2011 at 6:57 pm

First list all the pdfs with

ls -x lec*.pdf

lecture01.pdf            lecture02.pdf                lecture03.pdf
lecture04.pdf            lecture05.pdf            lecture06.pdf

now merge directly with ghostscript :
gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=merged.pdf lecture01.pdf  lecture02.pdf   lecture03.pdf  lecture04.pdf  lecture05.pdf lecture06.pdf

In last I had just middle-click pasted the names from each line of ls output and not the entire output at once because it contains \r \n.

Advertisement

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.