wicked_pdf 0.7.5 → 0.7.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pdf_helper.rb +3 -3
- data/lib/wicked_pdf.rb +3 -2
- metadata +4 -4
data/lib/pdf_helper.rb
CHANGED
@@ -51,7 +51,7 @@ module PdfHelper
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def make_pdf(options = {})
|
54
|
-
html_string = render_to_string(:template => options[:template], :layout => options[:layout])
|
54
|
+
html_string = render_to_string(:template => options[:template], :layout => options[:layout], :formats => options[:formats], :handlers => options[:handlers])
|
55
55
|
options = prerender_header_and_footer(options)
|
56
56
|
w = WickedPdf.new(options[:wkhtmltopdf])
|
57
57
|
w.pdf_from_string(html_string, options)
|
@@ -63,7 +63,7 @@ module PdfHelper
|
|
63
63
|
options[:template] ||= File.join(controller_path, action_name)
|
64
64
|
options[:disposition] ||= "inline"
|
65
65
|
if options[:show_as_html]
|
66
|
-
render :template => options[:template], :layout => options[:layout], :content_type => "text/html"
|
66
|
+
render :template => options[:template], :layout => options[:layout], :formats => options[:formats], :handlers => options[:handlers], :content_type => "text/html"
|
67
67
|
else
|
68
68
|
pdf_content = make_pdf(options)
|
69
69
|
File.open(options[:save_to_file], 'wb') {|file| file << pdf_content } if options[:save_to_file]
|
@@ -79,7 +79,7 @@ module PdfHelper
|
|
79
79
|
@hf_tempfiles = [] if ! defined?(@hf_tempfiles)
|
80
80
|
@hf_tempfiles.push( tf=WickedPdfTempfile.new("wicked_#{hf}_pdf.html") )
|
81
81
|
options[hf][:html][:layout] ||= options[:layout]
|
82
|
-
tf.write render_to_string(:template => options[hf][:html][:template], :layout => options[hf][:html][:layout], :locals => options[hf][:html][:locals])
|
82
|
+
tf.write render_to_string(:template => options[hf][:html][:template], :layout => options[hf][:html][:layout], :locals => options[hf][:html][:locals], :formats => options[hf][:html][:formats], :handlers => options[hf][:html][:handlers])
|
83
83
|
tf.flush
|
84
84
|
options[hf][:html].delete(:template)
|
85
85
|
options[hf][:html][:url] = "file://#{tf.path}"
|
data/lib/wicked_pdf.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
require 'logger'
|
5
5
|
require 'digest/md5'
|
6
6
|
require 'rbconfig'
|
7
|
-
require
|
7
|
+
require RbConfig::CONFIG['target_os'] == 'mingw32' && !(RUBY_VERSION =~ /1.9/) ? 'win32/open3' : 'open3'
|
8
8
|
require 'active_support/core_ext/class/attribute_accessors'
|
9
9
|
require 'active_support/core_ext/object/blank'
|
10
10
|
|
@@ -165,7 +165,8 @@ class WickedPdf
|
|
165
165
|
:post], "", :name_value)
|
166
166
|
r +=make_options(options, [ :redirect_delay,
|
167
167
|
:zoom,
|
168
|
-
:page_offset
|
168
|
+
:page_offset,
|
169
|
+
:javascript_delay], "", :numeric)
|
169
170
|
r +=make_options(options, [ :book,
|
170
171
|
:default_header,
|
171
172
|
:disable_javascript,
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wicked_pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 6
|
10
|
+
version: 0.7.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Miles Z. Sterret
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-03-14 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|