lib/princely/pdf_helper.rb in drnic-princely-1.1.3 vs lib/princely/pdf_helper.rb in drnic-princely-1.2.0
- old
+ new
@@ -35,10 +35,14 @@
# Remove asset ids on images with a regex
html_string.gsub!( /src=["'](\S+\?\d*)["']/i ) { |m| 'src="' + $1.split('?').first + '"' }
# Send the generated PDF file from our html string.
- return prince.pdf_from_string(html_string)
+ if filename = options[:filename] || options[:file]
+ prince.pdf_from_string_to_file(html_string, filename)
+ else
+ prince.pdf_from_string(html_string)
+ end
end
def make_and_send_pdf(pdf_name, options = {})
send_data(
make_pdf(options),