Module: PhantomPDF

Defined in:
lib/phantom_pdf.rb,
lib/phantom_pdf/version.rb

Constant Summary collapse

VERSION =
"0.0.2"

Instance Method Summary collapse

Instance Method Details

#url_to_pdf(url, output_file = Tempfile.new(['output', '.pdf'])) ⇒ Object



2
3
4
5
# File 'lib/phantom_pdf.rb', line 2

def url_to_pdf(url, output_file = Tempfile.new(['output', '.pdf']))
  `phantomjs #{ rasterize_path } '#{ url }' '#{ output_file.path }'`
  output_file
end