Skip to content

Instantly share code, notes, and snippets.

@osiro
Created April 26, 2012 02:46
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 osiro/2495333 to your computer and use it in GitHub Desktop.
Save osiro/2495333 to your computer and use it in GitHub Desktop.
PDF Generator
def generate_pdf
cmd = "/usr/bin/env wkhtmltopdf -O #{options[:layout]} -s #{options[:page_size]} -q --disable-smart-shrinking"
cmd << " -B 0mm -L 0mm -R 0mm -T 0mm"
cmd << " #{html_path} #{pdf_path}"
puts "About to run: #{cmd}"
`#{cmd}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment