Skip to content

Instantly share code, notes, and snippets.

@noah
Created February 19, 2009 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noah/67055 to your computer and use it in GitHub Desktop.
Save noah/67055 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# a small ghostscript wrapper to convert
# multiple pdf files into one single pdf
# 20090219 Noah K. Tilton <noah@downbe.at>
if ARGV.length < 1
puts "Usage: ./#{$0} <input pdf,[. . .]> <output pdf>"
exit
end
gs = `which gs`.chomp!
out = ARGV.pop
system("#{gs} -q -dNOPAUSE -dQUIET -sDEVICE=pdfwrite -sOutputFile=#{out} #{ARGV.join(' ')} -c quit")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment