Method: WickedPdf#pdf_from_string
- Defined in:
- lib/wicked_pdf.rb
#pdf_from_string(string, options = {}) ⇒ Object
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/wicked_pdf.rb', line 59 def pdf_from_string(string, = {}) = .dup .merge!(WickedPdf.config) { |_key, option, _config| option } string_file = WickedPdf::Tempfile.new('wicked_pdf.html', [:temp_path]) string_file.write_in_chunks(string) pdf_from_html_file(string_file.path, ) ensure if [:delete_temporary_files] && string_file string_file.close! elsif string_file string_file.close end end |