zebra-zpl 1.1.2 → 1.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd34dee028d5f1722409a1976624d6b34412730dbeaae95cca39994416a562d5
4
- data.tar.gz: 7d1f93a2ca77cd89d365b3b830eb27ed7efefa9bb12a06a42ab195c6d5088917
3
+ metadata.gz: dc4d0325bb49923c0936ec1a9945e0abd7ff840be83a761135b841ede695fadf
4
+ data.tar.gz: 8e085aeccc1055499e96c43c3585ecbe5e024d761618014583db6ca338941d24
5
5
  SHA512:
6
- metadata.gz: 3987b04350d612a3168247e181072d4f906ba0ed30e87f6b5acfd1be01907142bddac4aec4237cf1301b16c7d90f2ae4d2ba0ee29057f8dd6d4657ac2cb4d0d0
7
- data.tar.gz: 47baa040cbad0068c9d7cf4ddad08fc25e48dcfb84ddf8b9f01eb01251a894e159c1214afc3d18bc7102df0c3170043b90ab3571262d0cc044dea71cc9ade798
6
+ metadata.gz: 982e20fa56bc1deef5c9421e83c60da9c377e0d3acb68c4d3ec5ed33c309c86ef2ca48d51a2f62b6599ec8ac79db708b32db904620e72c2c3c252d7dcb600c28
7
+ data.tar.gz: 45fa3614e53bdc7b8ea1c95f75311768b1727cb1621776af195578c9781c96d0d5b023af151ad32b2a3ac48141e76c5faaa1b9e738b55e753c3fd7fc031da28f
@@ -1,6 +1,6 @@
1
- ### 1.1.3 (next)
1
+ ### 1.1.3 (10/05/2020)
2
2
 
3
- * Your contribution here.
3
+ * [#70](https://github.com/bbulpett/zebra-zpl/pull/70): Update max print speed from 6 to 14 - [@eke-bb](https://github.com/eke-bb)
4
4
 
5
5
  ### 1.1.2 (02/25/2019)
6
6
 
data/README.md CHANGED
@@ -13,6 +13,7 @@ Zebra::Zpl offers a Ruby DSL to design and print labels using the ZPL programmin
13
13
  - [Printing Labels](#printing-the-labels)
14
14
  - [Elements](#available-elements)
15
15
  - [Text](#text)
16
+ - [Raw ZPL](#raw-zpl)
16
17
  - [Barcodes](#barcodes)
17
18
  - [QR Codes](#qr-codes)
18
19
  - [Data Matrix](#data-matrix)
@@ -147,6 +148,26 @@ For the print modes, you can also use the constants:
147
148
  * `Zebra::Zpl::PrintMode::NORMAL`
148
149
  * `Zebra::Zpl::PrintMode::REVERSE`
149
150
 
151
+ ### Raw ZPL
152
+
153
+ The `Zebra::Zpl::Raw` class allows you to supply a raw string of ZPL to include on a label. This can be useful for small images, sections of static ZPL that never change, or if you have previously generated ZPL.
154
+
155
+ * `data`: The ZPL string to be printed.
156
+ * `position`: An array with the coordinates to place the text, in dots.
157
+ * `rotation`: The rotation for the text. More about the possible values below (see [Rotation](#elements-rotation) section).
158
+
159
+ ```ruby
160
+ label = Zebra::Zpl::Label.new width: 600, length: 305, print_speed: 6
161
+
162
+ zpl_string = "^GFA,1300,1300,13,,::::::O01IFE,N01KFE,N0MFC,M03NF,M0OFC,L03PF,L0QF8,K01QFE,K03RF,K07RF8,J01SFC,J03F9OFE7E,J07F01MFE03F,J07E007LF803F8,J0FE003KFE001FC,I01FEI0FC00FC001FE,I03FCI04M01FF,I07FCQ01FF,I07FCQ01FF8,I0FFCQ01FFC,I0FFEQ01FFC,001FFEQ01FFE,:003FFEQ03IF,003FFEQ01IF,007FFCR0IF,007FFCR0IF8,007FF8R07FF8,00IFS03FF8,00IFS03FFC,:00FFES01FFC,01FFES01FFC,01FFES01FFE,:01FFCS01FFE,:::::01FFES01FFE,::01FFES03FFE,01IFS03FFE,01IFS03FFC,01IF8R07FFC,00IF8R0IFC,00IFCR0IFC,00IFEQ01IFC,00JFQ03IF8,007IF8P07IF8,007IFCP0JF8,007JFO03JF,003F87FCN0KF,003F81FFM03JFE,001F80FFEK01KFE,001FC07FFCJ0LFC,I0FF03FF8J0LFC,I0FF03FF8J07KF8,I07F81FF8J07KF8,I03F807F8J07KF,I03FC004K07JFE,I01FCN07JFE,J0FEN07JFC,J07FN07JF8,J03F8M07JF,J01FCM07IFE,K0FFM07IFC,K07IF8J07IF8,K03IF8J07IF,L0IF8J07FFC,L07FF8J07FF8,L01FF8J07FE,M0FF8J07F8,M01F8J07E,N07K038,,::::::::::::::^FS"
163
+
164
+ raw_zpl = Zebra::Zpl::Raw.new(
165
+ data: zpl_string,
166
+ position: [50, 50],
167
+ )
168
+
169
+ label << raw_zpl
170
+ ```
150
171
 
151
172
  ### Barcodes
152
173
 
@@ -1,3 +1,4 @@
1
+ require_relative '../lib/zebra/zpl'
1
2
 
2
3
  def print_zpl_str(name, label)
3
4
  zpl = ''
@@ -37,6 +38,18 @@ label << text
37
38
  label << box
38
39
  print_zpl_str('text', label)
39
40
 
41
+ ################################################################################
42
+ # Raw ZPL
43
+ ################################################################################
44
+ label = new_label
45
+ zpl_string = "^GFA,1300,1300,13,,::::::O01IFE,N01KFE,N0MFC,M03NF,M0OFC,L03PF,L0QF8,K01QFE,K03RF,K07RF8,J01SFC,J03F9OFE7E,J07F01MFE03F,J07E007LF803F8,J0FE003KFE001FC,I01FEI0FC00FC001FE,I03FCI04M01FF,I07FCQ01FF,I07FCQ01FF8,I0FFCQ01FFC,I0FFEQ01FFC,001FFEQ01FFE,:003FFEQ03IF,003FFEQ01IF,007FFCR0IF,007FFCR0IF8,007FF8R07FF8,00IFS03FF8,00IFS03FFC,:00FFES01FFC,01FFES01FFC,01FFES01FFE,:01FFCS01FFE,:::::01FFES01FFE,::01FFES03FFE,01IFS03FFE,01IFS03FFC,01IF8R07FFC,00IF8R0IFC,00IFCR0IFC,00IFEQ01IFC,00JFQ03IF8,007IF8P07IF8,007IFCP0JF8,007JFO03JF,003F87FCN0KF,003F81FFM03JFE,001F80FFEK01KFE,001FC07FFCJ0LFC,I0FF03FF8J0LFC,I0FF03FF8J07KF8,I07F81FF8J07KF8,I03F807F8J07KF,I03FC004K07JFE,I01FCN07JFE,J0FEN07JFC,J07FN07JF8,J03F8M07JF,J01FCM07IFE,K0FFM07IFC,K07IF8J07IF8,K03IF8J07IF,L0IF8J07FFC,L07FF8J07FF8,L01FF8J07FE,M0FF8J07F8,M01F8J07E,N07K038,,::::::::::::::^FS"
46
+ raw_zpl = Zebra::Zpl::Raw.new(
47
+ data: zpl_string,
48
+ position: [50, 50],
49
+ )
50
+ label << raw_zpl
51
+ print_zpl_str('raw_zpl', label)
52
+
40
53
  ################################################################################
41
54
  # Barcode
42
55
  ################################################################################
@@ -17,7 +17,7 @@ module Zebra
17
17
  end
18
18
 
19
19
  def print_speed=(s)
20
- raise InvalidPrintSpeedError unless (0..6).include?(s)
20
+ raise InvalidPrintSpeedError unless (0..14).include?(s)
21
21
  @print_speed = s
22
22
  end
23
23
 
@@ -1,5 +1,5 @@
1
1
  module Zebra
2
2
  module Zpl
3
- VERSION = '1.1.2'.freeze
3
+ VERSION = '1.1.3'.freeze
4
4
  end
5
5
  end
@@ -32,7 +32,7 @@ describe Zebra::Zpl::Label do
32
32
  end
33
33
 
34
34
  it "validates the printing speed" do
35
- [-1, 8, "a"].each do |s|
35
+ [-1, 15, "a"].each do |s|
36
36
  expect {
37
37
  described_class.new print_speed: s
38
38
  }.to raise_error(Zebra::Zpl::Label::InvalidPrintSpeedError)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zebra-zpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Barnabas Bulpett
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-02-25 00:00:00.000000000 Z
13
+ date: 2020-10-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: img2zpl
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  requirements: []
190
- rubygems_version: 3.0.6
190
+ rubygems_version: 3.1.2
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: Simple DSL to create labels and send them to a Zebra printer using Ruby,