Created
March 9, 2013 00:16
-
-
Save brobertsaz/5121612 to your computer and use it in GitHub Desktop.
merge_pdfs_old_school
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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