wicked_pdf 0.7.7 → 0.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/README.md +3 -2
  2. data/lib/wicked_pdf.rb +6 -1
  3. metadata +5 -7
data/README.md CHANGED
@@ -61,7 +61,7 @@ or add this to your Gemfile:
61
61
  :encoding => 'TEXT',
62
62
  :user_style_sheet => 'URL',
63
63
  :cookie => ['_session_id SESSION_ID'], # could be an array or a single string in a 'name value' format
64
- :post => ['query QUERY_PARAM'], # could be an array or a single string in a 'name value' format
64
+ :post => ['query QUERY_PARAM'], # could be an array or a single string in a 'name value' format
65
65
  :redirect_delay => NUMBER,
66
66
  :zoom => FLOAT,
67
67
  :page_offset => NUMBER,
@@ -77,7 +77,8 @@ or add this to your Gemfile:
77
77
  :disable_smart_shrinking => true,
78
78
  :use_xserver => true,
79
79
  :no_background => true,
80
- :margin => {:top => SIZE, # default 10 (mm)
80
+ :extra => '' # directly inserted into the command to wkhtmltopdf
81
+ :margin => {:top => SIZE, # default 10 (mm)
81
82
  :bottom => SIZE,
82
83
  :left => SIZE,
83
84
  :right => SIZE},
data/lib/wicked_pdf.rb CHANGED
@@ -25,7 +25,7 @@ class WickedPdf
25
25
  end
26
26
 
27
27
  def pdf_from_string(string, options={})
28
- command = "\"#{@exe_path}\" #{parse_options(options)} #{'-q ' unless on_windows?}- - " # -q for no errors on stdout
28
+ command = "\"#{@exe_path}\" #{'-q ' unless on_windows?}#{parse_options(options)} - - " # -q for no errors on stdout
29
29
  print_command(command) if in_development_mode?
30
30
  pdf, err = Open3.popen3(command) do |stdin, stdout, stderr|
31
31
  stdin.binmode
@@ -58,6 +58,7 @@ class WickedPdf
58
58
 
59
59
  def parse_options(options)
60
60
  [
61
+ parse_extra(options),
61
62
  parse_header_footer(:header => options.delete(:header),
62
63
  :footer => options.delete(:footer),
63
64
  :layout => options[:layout]),
@@ -69,6 +70,10 @@ class WickedPdf
69
70
  ].join(' ')
70
71
  end
71
72
 
73
+ def parse_extra(options)
74
+ options[:extra].nil? ? '' : options[:extra]
75
+ end
76
+
72
77
  def parse_basic_auth(options)
73
78
  if options[:basic_auth]
74
79
  user, passwd = Base64.decode64(options[:basic_auth]).split(":")
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: 13
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 7
10
- version: 0.7.7
9
+ - 8
10
+ version: 0.7.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Miles Z. Sterret
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-15 00:00:00 -04:00
19
- default_executable:
18
+ date: 2012-04-23 00:00:00 Z
20
19
  dependencies: []
21
20
 
22
21
  description: |
@@ -46,7 +45,6 @@ files:
46
45
  - test/test_helper.rb
47
46
  - test/wicked_pdf_helper_test.rb
48
47
  - test/wicked_pdf_test.rb
49
- has_rdoc: true
50
48
  homepage: http://github.com/mileszs/wicked_pdf
51
49
  licenses: []
52
50
 
@@ -76,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
74
  requirements: []
77
75
 
78
76
  rubyforge_project:
79
- rubygems_version: 1.4.2
77
+ rubygems_version: 1.8.21
80
78
  signing_key:
81
79
  specification_version: 3
82
80
  summary: PDF generator (from HTML) plugin for Ruby on Rails