label_factory 1.0.0
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 +7 -0
- data/.gitignore +19 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +22 -0
- data/README.md +67 -0
- data/Rakefile +1 -0
- data/label_factory.gemspec +27 -0
- data/lib/label_factory/batch/base.rb +248 -0
- data/lib/label_factory/label/alias.rb +10 -0
- data/lib/label_factory/label/base.rb +22 -0
- data/lib/label_factory/label/cd.rb +11 -0
- data/lib/label_factory/label/rectangle.rb +15 -0
- data/lib/label_factory/label/round.rb +12 -0
- data/lib/label_factory/layout/base.rb +17 -0
- data/lib/label_factory/layout/circle.rb +11 -0
- data/lib/label_factory/layout/length.rb +33 -0
- data/lib/label_factory/layout/line.rb +12 -0
- data/lib/label_factory/layout/margin.rb +9 -0
- data/lib/label_factory/template/base.rb +53 -0
- data/lib/label_factory/template/glabel.rb +32 -0
- data/lib/label_factory/util/length_node.rb +22 -0
- data/lib/label_factory/version.rb +3 -0
- data/lib/label_factory.rb +47 -0
- data/templates/avery-iso-templates.xml +222 -0
- data/templates/avery-other-templates.xml +21 -0
- data/templates/avery-us-templates.xml +609 -0
- data/templates/glabels-2.0.dtd +329 -0
- data/templates/misc-iso-templates.xml +434 -0
- data/templates/misc-other-templates.xml +21 -0
- data/templates/misc-us-templates.xml +183 -0
- data/templates/paper-sizes.xml +37 -0
- data/templates/zweckform-iso-templates.xml +197 -0
- data/test/test_pdf_label_page.rb +134 -0
- metadata +133 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<Glabels-paper-sizes>
|
3
|
+
|
4
|
+
<!-- Most popular (at top of list) -->
|
5
|
+
<Paper-size id="US-Letter" _name="US Letter" width="8.5in" height="11in"/>
|
6
|
+
<Paper-size id="A4" _name="A4" width="210mm" height="297mm"/>
|
7
|
+
|
8
|
+
<!-- Other US paper sizes -->
|
9
|
+
<Paper-size id="US-Legal" _name="US Legal" width="8.5in" height="14in"/>
|
10
|
+
<Paper-size id="US-Executive" _name="US Executive" width="7.25in" height="10.5in"/>
|
11
|
+
|
12
|
+
<!-- Other ISO A series sizes -->
|
13
|
+
<Paper-size id="A0" _name="A0" width="841mm" height="1189mm"/>
|
14
|
+
<Paper-size id="A1" _name="A1" width="594mm" height="841mm"/>
|
15
|
+
<Paper-size id="A2" _name="A2" width="420mm" height="594mm"/>
|
16
|
+
<Paper-size id="A3" _name="A3" width="297mm" height="420mm"/>
|
17
|
+
<Paper-size id="A5" _name="A5" width="148mm" height="210mm"/>
|
18
|
+
<Paper-size id="A6" _name="A6" width="105mm" height="148mm"/>
|
19
|
+
<Paper-size id="A7" _name="A7" width="74mm" height="105mm"/>
|
20
|
+
<Paper-size id="A8" _name="A8" width="52mm" height="74mm"/>
|
21
|
+
<Paper-size id="A9" _name="A9" width="37mm" height="52mm"/>
|
22
|
+
<Paper-size id="A10" _name="A10" width="26mm" height="37mm"/>
|
23
|
+
|
24
|
+
<!-- ISO B series sizes -->
|
25
|
+
<Paper-size id="B0" _name="B0" width="1000mm" height="1414mm"/>
|
26
|
+
<Paper-size id="B1" _name="B1" width="707mm" height="1000mm"/>
|
27
|
+
<Paper-size id="B2" _name="B2" width="500mm" height="707mm"/>
|
28
|
+
<Paper-size id="B3" _name="B3" width="353mm" height="500mm"/>
|
29
|
+
<Paper-size id="B4" _name="B4" width="250mm" height="353mm"/>
|
30
|
+
<Paper-size id="B5" _name="B5" width="176mm" height="250mm"/>
|
31
|
+
<Paper-size id="B6" _name="B6" width="125mm" height="176mm"/>
|
32
|
+
<Paper-size id="B7" _name="B7" width="88mm" height="125mm"/>
|
33
|
+
<Paper-size id="B8" _name="B8" width="62mm" height="88mm"/>
|
34
|
+
<Paper-size id="B9" _name="B9" width="44mm" height="62mm"/>
|
35
|
+
<Paper-size id="B10" _name="B10" width="31mm" height="44mm"/>
|
36
|
+
|
37
|
+
</Glabels-paper-sizes>
|
@@ -0,0 +1,197 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
<Glabels-templates>
|
3
|
+
|
4
|
+
|
5
|
+
<!-- ******************************************************************** -->
|
6
|
+
<!-- Zweckform A4 products -->
|
7
|
+
<!-- ******************************************************************** -->
|
8
|
+
|
9
|
+
<!-- =================================================================== -->
|
10
|
+
<!-- Zweckform 4761: Lever Arch File Labels, 192 x 61 mm, 4 per sheet -->
|
11
|
+
<!-- =================================================================== -->
|
12
|
+
<Template name="Avery 4761" size="A4" _description="Lever Arch File Labels">
|
13
|
+
<Label-rectangle id="0" width="544.25" height="172.9" round="5">
|
14
|
+
<Markup-margin size="5"/>
|
15
|
+
<Layout nx="1" ny="4" x0="25" y0="75" dx="544.25" dy="172.9"/>
|
16
|
+
</Label-rectangle>
|
17
|
+
</Template>
|
18
|
+
|
19
|
+
<!-- =================================================================== -->
|
20
|
+
<!-- Zweckform 3651: Rectangular Labels, 52 x 29.5 mm, 40 per sheet -->
|
21
|
+
<!-- =================================================================== -->
|
22
|
+
<Template name="Avery 3651" size="A4" _description="Rectangular Labels">
|
23
|
+
<Label-rectangle id="0" width="147.4016" height="83.6220" round="0">
|
24
|
+
<Markup-margin size="5"/>
|
25
|
+
<Layout nx="4" ny="10" x0="2.834" y0="2.834" dx="147.4016" dy="83.6220"/>
|
26
|
+
</Label-rectangle>
|
27
|
+
</Template>
|
28
|
+
|
29
|
+
<!-- ====================================================================-->
|
30
|
+
<!-- Zweckform 3654: CD Labels 2 per Template -->
|
31
|
+
<!-- ====================================================================-->
|
32
|
+
<Template name="Avery 3654" size="A4" _description="CD/DVD Labels">
|
33
|
+
<Label-cd id="0" radius="165.78" hole="58.09" waste="5">
|
34
|
+
<Markup-margin size="5"/>
|
35
|
+
<Layout nx="1" ny="2" x0="131.78" y0="58.7998" dx="0" dy="387.97"/>
|
36
|
+
</Label-cd>
|
37
|
+
</Template>
|
38
|
+
|
39
|
+
<!-- =================================================================== -->
|
40
|
+
<!-- Zweckform 3659: Rectangular Labels, 97 x 42.125 mm, 12 per sheet -->
|
41
|
+
<!-- =================================================================== -->
|
42
|
+
<Template name="Avery 3659" size="A4" _description="Mailing Labels">
|
43
|
+
<Label-rectangle id="0" width="274" height="120.5" round="0">
|
44
|
+
<Markup-margin size="5"/>
|
45
|
+
<Layout nx="2" ny="6" x0="22.68" y0="60" dx="274" dy="120.5"/>
|
46
|
+
</Label-rectangle>
|
47
|
+
</Template>
|
48
|
+
|
49
|
+
<!-- =================================================================== -->
|
50
|
+
<!-- Zweckform 3669: Rectangular Labels, 70 x 50.8mm, 15 per sheet -->
|
51
|
+
<!-- =================================================================== -->
|
52
|
+
<Template name="Avery 3669" size="A4" _description="QSL-Karten Etiketten 70mm x 50,8mm">
|
53
|
+
<Label-rectangle id="0" width="198.425" height="144" round="0">
|
54
|
+
<Markup-margin size="5"/>
|
55
|
+
<Layout nx="3" ny="5" x0="0" y0="61" dx="198.425" dy="144"/>
|
56
|
+
</Label-rectangle>
|
57
|
+
</Template>
|
58
|
+
|
59
|
+
<!-- =================================================================== -->
|
60
|
+
<!-- Zweckform 3688: Ordnerruecken Labels -->
|
61
|
+
<!-- =================================================================== -->
|
62
|
+
<Template name="Avery 3688" size="A4" description="File Back Labels">
|
63
|
+
<Label-rectangle id="0" width="544.252pt" height="172.913pt" round="0pt" waste="0pt">
|
64
|
+
<Markup-margin size="9.07087pt"/>
|
65
|
+
<Layout nx="1" ny="4" x0="28.3465pt" y0="76.5354pt" dx="544.252pt" dy="172.913pt"/>
|
66
|
+
</Label-rectangle>
|
67
|
+
</Template>
|
68
|
+
|
69
|
+
<!-- =================================================================== -->
|
70
|
+
<!-- Zweckform 4732: Multi-purpose Stick+Lift labels -->
|
71
|
+
<!-- =================================================================== -->
|
72
|
+
<Template name="Avery 4732" size="A4" description="Multi-purpose Stick+Lift Labels">
|
73
|
+
<Label-rectangle id="0" width="102.047pt" height="48.189pt" round="5.66929pt" waste="0pt">
|
74
|
+
<Markup-margin size="5.66929pt"/>
|
75
|
+
<Layout nx="5" ny="16" x0="31.1811pt" y0="36.8504pt" dx="107.717pt" dy="48.189pt"/>
|
76
|
+
</Label-rectangle>
|
77
|
+
</Template>
|
78
|
+
|
79
|
+
<!-- =================================================================== -->
|
80
|
+
<!-- Zweckform 4746: Video Labels, 147,32 x 20 mm, 13 per sheet -->
|
81
|
+
<!-- =================================================================== -->
|
82
|
+
<Template name="Avery 4746" size="A4" _description="Video Labels (back)">
|
83
|
+
<Label-rectangle id="0" width="416.6" height="56.6929" round="5">
|
84
|
+
<Markup-margin size="5"/>
|
85
|
+
<Layout nx="1" ny="13" x0="88.8377" y0="52.2425" dx="416.6" dy="56.6929"/>
|
86
|
+
</Label-rectangle>
|
87
|
+
</Template>
|
88
|
+
|
89
|
+
<!-- =================================================================== -->
|
90
|
+
<!-- Zweckform 4780: Allround Labels, 48,5 x 25,4 mm, 40 per sheet -->
|
91
|
+
<!-- =================================================================== -->
|
92
|
+
<Template name="Avery 4780" size="A4" _description="Allround Labels">
|
93
|
+
<Label-rectangle id="0" width="137.48" height="72" round="0">
|
94
|
+
<Markup-margin size="5"/>
|
95
|
+
<Layout nx="4" ny="10" x0="23" y0="53.8898" dx="137.48" dy="72"/>
|
96
|
+
</Label-rectangle>
|
97
|
+
</Template>
|
98
|
+
|
99
|
+
<!-- =================================================================== -->
|
100
|
+
<!-- Zweckform 3474: Address Labels, 70 x 37 mm, 24 per sheet -->
|
101
|
+
<!-- =================================================================== -->
|
102
|
+
<Template name="Avery 3474" size="A4" _description="Address Labels">
|
103
|
+
<Label-rectangle id="0" width="70mm" height="37mm" round="0">
|
104
|
+
<Markup-margin size="0"/>
|
105
|
+
<Layout nx="3" ny="8" x0="0" y0="0" dx="70mm" dy="37mm"/>
|
106
|
+
</Label-rectangle>
|
107
|
+
</Template>
|
108
|
+
|
109
|
+
<!-- =================================================================== -->
|
110
|
+
<!-- Zweckform 3475: Address Labels, 70 x 30 mm, 24 per sheet -->
|
111
|
+
<!-- =================================================================== -->
|
112
|
+
<Template name="Avery 3475" size="A4" _description="Address Labels">
|
113
|
+
<Label-rectangle id="0" width="198.570" height="102.121" round="0">
|
114
|
+
<Markup-margin size="0"/>
|
115
|
+
<Layout nx="3" ny="8" x0="0" y0="12.566" dx="198.570" dy="102.121"/>
|
116
|
+
</Label-rectangle>
|
117
|
+
</Template>
|
118
|
+
|
119
|
+
<!-- =================================================================== -->
|
120
|
+
<!-- Zweckform 3490: Rectangular Labels, 70 x 36 mm, 24 per sheet -->
|
121
|
+
<!-- =================================================================== -->
|
122
|
+
<Template name="Avery 3490" size="A4" _description="Rectangular Copier Labels">
|
123
|
+
<Label-rectangle id="0" width="198.425" height="102.047" round="0">
|
124
|
+
<Markup-margin size="5"/>
|
125
|
+
<Layout nx="3" ny="8" x0="" y0="12.557" dx="198.425" dy="102.047"/>
|
126
|
+
</Label-rectangle>
|
127
|
+
</Template>
|
128
|
+
|
129
|
+
<!-- =================================================================== -->
|
130
|
+
<!-- Zweckform 4781: Rectangular Labels, 97 x 42.3 mm, 12 per sheet -->
|
131
|
+
<!-- =================================================================== -->
|
132
|
+
<Template name="Avery 4781" size="A4" _description="Rectangular Copier Labels">
|
133
|
+
<Label-rectangle id="0" width="274.960" height="119.905" round="0">
|
134
|
+
<Markup-margin size="5"/>
|
135
|
+
<Layout nx="2" ny="6" x0="22.677" y0="61.030" dx="274.960" dy="119.905"/>
|
136
|
+
</Label-rectangle>
|
137
|
+
</Template>
|
138
|
+
|
139
|
+
<!-- =================================================================== -->
|
140
|
+
<!-- Zweckform 6091: Correction and Cover, 64.6 x 33.8 mm, 24 per sheet -->
|
141
|
+
<!-- =================================================================== -->
|
142
|
+
<Template name="Avery 6091" size="A4" _description="Correction and Cover-up Labels">
|
143
|
+
<Label-rectangle id="0" width="183.118" height="95.811" round="0">
|
144
|
+
<Markup-margin size="5"/>
|
145
|
+
<Layout nx="3" ny="8" x0="22.961" y0="37.502" dx="183.118" dy="95.881"/>
|
146
|
+
</Label-rectangle>
|
147
|
+
</Template>
|
148
|
+
|
149
|
+
<!-- =================================================================== -->
|
150
|
+
<!-- Zweckform 6015: CD Labels, 2 per Template -->
|
151
|
+
<!-- =================================================================== -->
|
152
|
+
<Template name="Avery 6015" size="A4" _description="CD/DVD Labels">
|
153
|
+
<Label-cd id="0" radius="165.827" hole="58.110" waste="5">
|
154
|
+
<Markup-margin size="5"/>
|
155
|
+
<Layout nx="1" ny="2" x0="131.811" y0="60.746" dx="0" dy="388.346"/>
|
156
|
+
</Label-cd>
|
157
|
+
</Template>
|
158
|
+
|
159
|
+
<!-- =================================================================== -->
|
160
|
+
<!-- Zweckform 6021: Allround Labels -->
|
161
|
+
<!-- =================================================================== -->
|
162
|
+
<Template name="Avery 6021" size="A4" description="Allround Labels">
|
163
|
+
<Label-rectangle id="0" width="130.392pt" height="47.9055pt" round="0pt" waste="0pt">
|
164
|
+
<Markup-margin size="5pt"/>
|
165
|
+
<Layout nx="4" ny="16" x0="24.0945pt" y0="39.6853pt" dx="136.913pt" dy="47.9055pt"/>
|
166
|
+
</Label-rectangle>
|
167
|
+
</Template>
|
168
|
+
|
169
|
+
<!-- =================================================================== -->
|
170
|
+
<!-- Zweckform 32010: Business Cards, 54.0 x 85.0 mm, 10 per sheet -->
|
171
|
+
<!-- =================================================================== -->
|
172
|
+
<Template name="Zweckform 32010" size="A4" _description="Business Cards">
|
173
|
+
<Label-rectangle id="0" width="240.94" height="153.07" round="0">
|
174
|
+
<Markup-margin size="5"/>
|
175
|
+
<Layout nx="2" ny="5" x0="40" y0="40" dx="269" dy="153"/>
|
176
|
+
</Label-rectangle>
|
177
|
+
<Alias name="DECAdry SCW-2090"/>
|
178
|
+
<Alias name="DECAdry OCB-3327"/>
|
179
|
+
<Alias name="DECAdry DAW-327"/>
|
180
|
+
</Template>
|
181
|
+
|
182
|
+
<!-- =================================================================== -->
|
183
|
+
<!-- Zweckform 4760: File Labels, 192 x 38 mm, 7 per sheet -->
|
184
|
+
<!-- =================================================================== -->
|
185
|
+
<Template name="Avery 4760" size="A4" description="File Back Labels">
|
186
|
+
<Label-rectangle id="0" width="544.252pt" height="107.717pt" round="5.66929pt" waste="0pt">
|
187
|
+
<Markup-margin size="9pt"/>
|
188
|
+
<Layout nx="1" ny="7" x0="25.5118pt" y0="43.7386pt" dx="544.252pt" dy="107.717pt"/>
|
189
|
+
</Label-rectangle>
|
190
|
+
</Template>
|
191
|
+
|
192
|
+
|
193
|
+
</Glabels-templates>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
@@ -0,0 +1,134 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'test/unit'
|
3
|
+
require 'label_factory'
|
4
|
+
|
5
|
+
class TestPdfLabelBatch < Test::Unit::TestCase
|
6
|
+
ROOT = File.expand_path(File.dirname(__FILE__) + "/../")
|
7
|
+
def setup
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_new_with_tempalte_name
|
11
|
+
p = LabelFactory::Batch::Base.new("Avery 5366")
|
12
|
+
assert p
|
13
|
+
assert_equal p.template.name, "Avery 5366"
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_new_with_alias_name
|
17
|
+
p = LabelFactory::Batch::Base.new("Avery 8166")
|
18
|
+
assert p
|
19
|
+
assert_equal p.template.name, "Avery 5366"
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_new_with_paper_type
|
23
|
+
p = LabelFactory::Batch::Base.new("Avery 5366", {paper: 'Legal'})
|
24
|
+
assert p
|
25
|
+
assert_equal p.pdf.page_width, 612.0
|
26
|
+
assert_equal p.pdf.page_height, 1008.0
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_new_with_tempalte_not_found
|
30
|
+
assert_raise(RuntimeError) {
|
31
|
+
p = LabelFactory::Batch::Base.new('Some Non-Existing')
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
#TODO other options are possible for pdf_options, we need to test those at some point
|
36
|
+
|
37
|
+
def test_PdfLabelBatch_load_tempalte_set
|
38
|
+
LabelFactory::Batch::Base.load_template_set("#{ROOT}/templates/avery-iso-templates.xml")
|
39
|
+
#Avery 7160 is found in avery-iso-templates
|
40
|
+
p = LabelFactory::Batch::Base.new("Avery 7160")
|
41
|
+
assert p
|
42
|
+
assert_equal p.pdf.page_width, 595.28
|
43
|
+
assert_equal p.pdf.page_height, 841.89
|
44
|
+
LabelFactory::Batch::Base.load_template_set("#{ROOT}/templates/avery-us-templates.xml")
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_PdfLabelBatch_all_template_names
|
48
|
+
#what happens if we havn't loaded a template yet?
|
49
|
+
t = LabelFactory::Batch::Base.all_template_names
|
50
|
+
assert t
|
51
|
+
assert_equal t.class, Array
|
52
|
+
assert_equal t.count, 292
|
53
|
+
assert_equal t.first, "Avery 5160"
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_add_label_3_by_10
|
57
|
+
p = LabelFactory::Batch::Base.new("Avery 8160") # label is 2 x 10
|
58
|
+
p.add_label("&*\%Positoin 15", position: 15) # should add col 2, row 1
|
59
|
+
#does the use_margin = true work?
|
60
|
+
p.add_label('With Margin', use_margin: true, position: 4)
|
61
|
+
#with out the margin?
|
62
|
+
p.add_label('No Margin', position: 5, use_margin: false)
|
63
|
+
p.add_label('This is the song that never ends, yes it goes on and on my friends', position: 7 )
|
64
|
+
p.add_label('X Offset = 4, Y Offset = -6', position: 9, offset_x: 4, offset_y: -6)
|
65
|
+
p.add_label('Centered', position: 26, justification: :center) # should add col 2, row 15
|
66
|
+
p.add_label('[Right justified]', justification: :right, position: 28)# col 2, row 14, right justified.
|
67
|
+
p.add_label('col 2 row 15', position: 29) # should add col 2, row 15
|
68
|
+
p.add_label('This was added first and has a BIG font', position: 8, font_size: 16)
|
69
|
+
p.add_label('This was added last and has a small font', position: 8, font_size: 8, offset_y: -40)
|
70
|
+
p.draw_boxes(false, true)
|
71
|
+
#TODO Anybody out there think of a better way to test this?
|
72
|
+
p.save_as("#{ROOT}/test_add_label_output.pdf")
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_add_label_3_by_10_multi_page
|
76
|
+
p = LabelFactory::Batch::Base.new("Avery 8160") # label is 2 x 10
|
77
|
+
p.draw_boxes(false, true)
|
78
|
+
p.add_label('Position 15', position: 15) # should add col 2, row 1
|
79
|
+
#does the use_margin = true work?
|
80
|
+
p.add_label('using margin', use_margin: true, position: 4)
|
81
|
+
#with out the margin?
|
82
|
+
p.add_label('No Margin', position: 5, use_margin: false)
|
83
|
+
p.add_label('This should be on a new page', position: 48)
|
84
|
+
p.add_label('This should be first a page 2', position: 30)
|
85
|
+
#TODO Anybody out there think of a better way to test this?
|
86
|
+
p.save_as("#{ROOT}/test_add_multi_page.pdf")
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_add_labels_with_multiple_lines_align_and_font_types
|
90
|
+
pdf = LabelFactory::Batch::Base.new('Avery 8160')
|
91
|
+
pdf.draw_boxes(false, false)
|
92
|
+
|
93
|
+
contents = [];
|
94
|
+
contents << {text: 'This', justification: :center, font_size: 8, font_type: 'Courier'}
|
95
|
+
contents << {text: 'Is a', justification: :right, font_size: 8, font_type: 'Helvetica-BoldOblique'}
|
96
|
+
contents << {text: 'Test', font_type: 'Times-Roman'}
|
97
|
+
|
98
|
+
5.times do |i|
|
99
|
+
pdf.add_multiline_label(contents,i)
|
100
|
+
end
|
101
|
+
pdf.save_as("#{ROOT}/test_add_labels_with_multiple_lines_align_and_font_types.pdf")
|
102
|
+
end
|
103
|
+
|
104
|
+
def test_multipage_2
|
105
|
+
p = LabelFactory::Batch::Base.new("Avery 8160") # label is 2 x 10
|
106
|
+
p.draw_boxes(false, true)
|
107
|
+
100.times do |i|
|
108
|
+
p.add_label("Position #{i}", position: i) # should add col 1, row 2
|
109
|
+
end
|
110
|
+
p.save_as("#{ROOT}/test_add_multi_page2.pdf")
|
111
|
+
end
|
112
|
+
|
113
|
+
def test_add_many_labels
|
114
|
+
p = LabelFactory::Batch::Base.new("Avery 8160") # label is 2 x 10
|
115
|
+
#without positoin, so start at 1
|
116
|
+
p.add_many_labels('Hello Five Times!', count: 5)
|
117
|
+
p.add_many_labels('Hellow four more times, starting at 15', count: 4, position: 15)
|
118
|
+
p.save_as("#{ROOT}/test_add_many_label_output.pdf")
|
119
|
+
end
|
120
|
+
|
121
|
+
def test_draw_boxes
|
122
|
+
p = LabelFactory::Batch::Base.new("Avery 5366") # label is 2 x 10
|
123
|
+
p.draw_boxes
|
124
|
+
p.save_as("#{ROOT}/test_draw_boxes_output.pdf")
|
125
|
+
end
|
126
|
+
|
127
|
+
def test_label_information_no_crash
|
128
|
+
LabelFactory::Batch::Base.all_templates.each do |t|
|
129
|
+
t.nx
|
130
|
+
t.ny
|
131
|
+
t.find_description
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
metadata
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: label_factory
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- gagoar
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-07-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: metaskills-pdf-writer
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: xml-mapping
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.8.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.8.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: pdf label creation in ruby
|
70
|
+
email:
|
71
|
+
- xeroice@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- .gitignore
|
77
|
+
- Gemfile
|
78
|
+
- LICENSE.txt
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
81
|
+
- label_factory.gemspec
|
82
|
+
- lib/label_factory.rb
|
83
|
+
- lib/label_factory/batch/base.rb
|
84
|
+
- lib/label_factory/label/alias.rb
|
85
|
+
- lib/label_factory/label/base.rb
|
86
|
+
- lib/label_factory/label/cd.rb
|
87
|
+
- lib/label_factory/label/rectangle.rb
|
88
|
+
- lib/label_factory/label/round.rb
|
89
|
+
- lib/label_factory/layout/base.rb
|
90
|
+
- lib/label_factory/layout/circle.rb
|
91
|
+
- lib/label_factory/layout/length.rb
|
92
|
+
- lib/label_factory/layout/line.rb
|
93
|
+
- lib/label_factory/layout/margin.rb
|
94
|
+
- lib/label_factory/template/base.rb
|
95
|
+
- lib/label_factory/template/glabel.rb
|
96
|
+
- lib/label_factory/util/length_node.rb
|
97
|
+
- lib/label_factory/version.rb
|
98
|
+
- templates/avery-iso-templates.xml
|
99
|
+
- templates/avery-other-templates.xml
|
100
|
+
- templates/avery-us-templates.xml
|
101
|
+
- templates/glabels-2.0.dtd
|
102
|
+
- templates/misc-iso-templates.xml
|
103
|
+
- templates/misc-other-templates.xml
|
104
|
+
- templates/misc-us-templates.xml
|
105
|
+
- templates/paper-sizes.xml
|
106
|
+
- templates/zweckform-iso-templates.xml
|
107
|
+
- test/test_pdf_label_page.rb
|
108
|
+
homepage: http://github.com/eventioz/label_factory
|
109
|
+
licenses:
|
110
|
+
- MIT
|
111
|
+
metadata: {}
|
112
|
+
post_install_message:
|
113
|
+
rdoc_options: []
|
114
|
+
require_paths:
|
115
|
+
- lib
|
116
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
requirements: []
|
127
|
+
rubyforge_project:
|
128
|
+
rubygems_version: 2.0.3
|
129
|
+
signing_key:
|
130
|
+
specification_version: 4
|
131
|
+
summary: http://github.com/eventioz/label_factory
|
132
|
+
test_files:
|
133
|
+
- test/test_pdf_label_page.rb
|