easyzpl 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbabe402e3cf1d8f39a7fe870988511f6ebddacd
4
- data.tar.gz: 1bb9367bb7746c7ab9317baf7cc675b91ca3877a
3
+ metadata.gz: b3f80728e50bc7efc1bd5dd7f7e71876980a761a
4
+ data.tar.gz: ff91384743df90818d2f7431bc5e82787d91d90e
5
5
  SHA512:
6
- metadata.gz: d4c38d67b19d1c4453ea137ca31934b1aeefd8c98a19ea808042cf2152bdfd75aff421547e4cbc2fe9eeaf93166c16d14259412b64cae0fcbc88c16c48d70941
7
- data.tar.gz: bf8bf8dc14e882279a977b05d7f8581e86fd6cfe5669b089e9d160c586a297cf1e622c1e8569217b4325c2c769ad05b4761c7da1d5e651ba7b5eaaeaa3fe036c
6
+ metadata.gz: 7a1ad382f6d19237f4e3948b16c1a7f3bd9fa8a7643757e71b882686a4969dfa863867aa02c8587493e6dec69762859f3aab0f687eb262539b51ee4fb5736226
7
+ data.tar.gz: 72919297cf488da3567bde5baa0da1458a7dba0017b9fbd9448ba2a9ecb3eec65d416d9898af7222fa066c52d778e3390f2e1ba7e5935149e27002cdc5f5c5a6
data/lib/easyzpl/label.rb CHANGED
@@ -72,26 +72,28 @@ module Easyzpl
72
72
  def text_field(text, x, y, params = {})
73
73
  x = 0 unless numeric?(x)
74
74
  y = 0 unless numeric?(y)
75
- options = { height: 10.to_s, width: 10.to_s }.merge(params)
75
+ options = { height: 10, width: 10 }.merge(params)
76
76
  label_data.push('^FO' + x.to_s + ',' + y.to_s + '^AFN,' +
77
77
  options[:height].to_s + ',' + options[:width].to_s +
78
78
  '^FD' + text + '^FS')
79
79
 
80
80
  return unless label_height && label_width
81
- pdf.text_box text, at: [x, label_width - y]
81
+ pdf.text_box text, at: [x, label_width - y - 1], size: options[:height]
82
82
  end
83
83
 
84
84
  # Prints a bar code in barcode39 font
85
- def bar_code_39(bar_code_string, x, y)
85
+ def bar_code_39(bar_code_string, x, y, params = {})
86
86
  x = 0 unless numeric?(x)
87
87
  y = 0 unless numeric?(y)
88
88
  label_data.push('^FO' + x.to_s + ',' + y.to_s + '^B3N,Y,20,N,N^FD' +
89
89
  bar_code_string + '^FS')
90
90
 
91
91
  return unless label_height && label_width
92
- pdf.bounding_box [x, Integer(label_width) - y - 40], width: 50 do
92
+ options = { height: 20 }.merge(params)
93
+ pdf.bounding_box [x, Integer(label_width) - y - options[:height]],
94
+ width: options[:height] do
93
95
  barcode = Barby::Code39.new(bar_code_string)
94
- barcode.annotate_pdf(pdf)
96
+ barcode.annotate_pdf(pdf, height: options[:height])
95
97
  end
96
98
  end
97
99
 
@@ -1,4 +1,4 @@
1
1
  # Section holds the version number of the Gem
2
2
  module Easyzpl
3
- VERSION = '0.2.3'
3
+ VERSION = '0.2.4'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easyzpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Grigajtis