Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@brobertsaz
Created March 9, 2013 00:16
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 brobertsaz/5121612 to your computer and use it in GitHub Desktop.
Save brobertsaz/5121612 to your computer and use it in GitHub Desktop.
merge_pdfs_old_school
def merge_pdfs
pdfs = []
pdfs << @bulletin.pdf.path
@bulletin.bulletin_inserts.first.bulletin_insert_items.each do |bii|
if bii.pdf.present?
pdfs << bii.pdf.path
end
end
if pdfs.count > 1
system "gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=temp.pdf #{pdfs.join(' ')}"
system "cat '/Users/bob/Projects/bulletin-builder/temp.pdf' > #{@bulletin.pdf.path}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment