lib/wicked_pdf.rb in wicked_pdf-0.7.8 vs lib/wicked_pdf.rb in wicked_pdf-0.7.9
- old
+ new
@@ -105,10 +105,19 @@
unless options[hf].blank?
opt_hf = options[hf]
r += make_options(opt_hf, [:center, :font_name, :left, :right], "#{hf.to_s}")
r += make_options(opt_hf, [:font_size, :spacing], "#{hf.to_s}", :numeric)
r += make_options(opt_hf, [:line], "#{hf.to_s}", :boolean)
+ if options[hf] && options[hf][:content]
+ @hf_tempfiles = [] if ! defined?(@hf_tempfiles)
+ @hf_tempfiles.push( tf=WickedPdfTempfile.new("wicked_#{hf}_pdf.html") )
+ tf.write options[hf][:content]
+ tf.flush
+ options[hf].delete(:content)
+ options[hf][:html] = {}
+ options[hf][:html][:url] = "file://#{tf.path}"
+ end
unless opt_hf[:html].blank?
r += make_option("#{hf.to_s}-html", opt_hf[:html][:url]) unless opt_hf[:html][:url].blank?
end
end
end unless options.blank?
@@ -173,10 +182,10 @@
:page_offset,
:javascript_delay], "", :numeric)
r +=make_options(options, [ :book,
:default_header,
:disable_javascript,
- :greyscale,
+ :grayscale,
:lowquality,
:enable_plugins,
:disable_internal_links,
:disable_external_links,
:print_media_type,