prawn_report 1.9.24 → 1.9.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/report.rb +1 -1
- data/lib/report_helpers.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dce1186db37c24dcb9487a3cba817b1adc6c424085f4024f4580e59a6314838d
|
4
|
+
data.tar.gz: c8a65acaa553927dce5718e03ebf01041685e02983fba3d9163363193e9d39b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d74665747a0e00e1b887d4d34a5aa450468604126f186f44d8d5bcdace0304862580c5fd418a5b8697c599cdd7b4b92c07c343b02f2eedf5fa784aec6224b8cc
|
7
|
+
data.tar.gz: 796a6e62102375815c0e13828d2be400c5d7693e1d2047d17edf6e1865c12735d616a9ff9a7f6a9285c1fd05f8d4512fc1afff1e2d319c6e9e112ea5be805a29
|
data/lib/report.rb
CHANGED
@@ -9,7 +9,7 @@ require File.expand_path(File.dirname(__FILE__) + "/report_info")
|
|
9
9
|
module PrawnReport
|
10
10
|
unless defined? DEFAULT_REPORT_PARAMS
|
11
11
|
DEFAULT_REPORT_PARAMS = {:page_size => 'A4', :margin => [20, 20, 20, 20],
|
12
|
-
:page_layout => :portrait}
|
12
|
+
:page_layout => :portrait, :encoding => 'utf8'}
|
13
13
|
|
14
14
|
LABEL_SIZE = 6
|
15
15
|
TEXT_SIZE = 10
|
data/lib/report_helpers.rb
CHANGED
@@ -12,14 +12,14 @@ module PrawnReport
|
|
12
12
|
@pdf.text_box(label, :size => LABEL_SIZE, :at => [@x + 2, y - 2], :width => width - 2,
|
13
13
|
:height => LABEL_SIZE, :valign => :top)
|
14
14
|
h_text = height.nil? ? TEXT_SIZE : height - LABEL_SIZE - 4
|
15
|
-
@pdf.text_box(text.to_s
|
15
|
+
@pdf.text_box(text.to_s || '', { :size => TEXT_SIZE, :at => [@x + 2, y - LABEL_SIZE - 4],
|
16
16
|
:width => width - 2, :height => h_text, :valign => :top }.merge(options))
|
17
17
|
@x += width
|
18
18
|
end
|
19
19
|
|
20
20
|
def text(text, width, options = {})
|
21
21
|
font_size = options[:font_size] || TEXT_SIZE
|
22
|
-
@pdf.text_box(text.to_s
|
22
|
+
@pdf.text_box(text.to_s, :size => font_size, :style => options[:style], :at => [@x, y - 4],
|
23
23
|
:width => width, :height => font_size,
|
24
24
|
:valign => (options[:valign] || :top),
|
25
25
|
:align => (options[:align] || :left)
|