Skip to content

Instantly share code, notes, and snippets.

@badboy
Created January 30, 2019 15:05
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 badboy/3a73440ca40a460ab69455910d7e8d21 to your computer and use it in GitHub Desktop.
Save badboy/3a73440ca40a460ab69455910d7e8d21 to your computer and use it in GitHub Desktop.
def combine(file, background, out)
file = File.join("/data", file)
background = File.join("/data", background)
out = File.join("/data", out)
cmd = "docker run --rm -ti -v $(pwd):/data r3ddox/node-pdftk pdftk #{file} background #{background} output #{out}"
#puts "Executing: #{cmd.inspect}"
`#{cmd}`
end
def pdfmerge(files, out)
out = File.join(COMPLETE_DIR, out)
inp = files.join(" ")
`"/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o #{out} #{inp}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment