ruby_danfe 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/ruby_danfe.rb +447 -436
  2. data/ruby_danfe.gemspec +1 -1
  3. metadata +3 -3
data/lib/ruby_danfe.rb CHANGED
@@ -4,665 +4,676 @@ require 'nokogiri'
4
4
 
5
5
  module RubyDanfe
6
6
 
7
- version = "0.0.2"
7
+ version = "0.0.3"
8
8
 
9
9
  class XML
10
- def initialize(xml_filename)
11
- @xml = Nokogiri::XML(File.new(xml_filename))
10
+ def initialize(xml)
11
+ @xml = Nokogiri::XML(xml)
12
12
  end
13
13
  def [](xpath)
14
14
  node = @xml.css(xpath)
15
15
  return node ? node.text : ''
16
16
  end
17
17
  end
18
-
19
- def self.generate(pdf_filename, xml_filename)
20
18
 
21
- xml = XML.new(xml_filename)
22
-
23
- Prawn::Document.generate(pdf_filename) do |pdf|
19
+ def self.generatePDFFromXML(xml)
20
+
21
+ pdf = Prawn::Document.new
24
22
 
25
- # rectangle
26
- pdf.stroke_rectangle [328, 653], 222, 22
23
+ # rectangle
24
+ pdf.stroke_rectangle [328, 653], 222, 22
27
25
 
28
- # rectangle
29
- pdf.stroke_rectangle [328, 697], 222, 84
26
+ # rectangle
27
+ pdf.stroke_rectangle [328, 697], 222, 84
30
28
 
31
- # rectangle
32
- pdf.stroke_rectangle [347, 457], 96, 18
29
+ # rectangle
30
+ pdf.stroke_rectangle [347, 457], 96, 18
33
31
 
34
- # rectangle
35
- pdf.stroke_rectangle [443, 749], 107, 37
32
+ # rectangle
33
+ pdf.stroke_rectangle [443, 749], 107, 37
36
34
 
37
- # rectangle
38
- pdf.stroke_rectangle [112, 526], 63, 44
35
+ # rectangle
36
+ pdf.stroke_rectangle [112, 526], 63, 44
39
37
 
40
- # rectangle
41
- pdf.stroke_rectangle [49, 526], 63, 44
38
+ # rectangle
39
+ pdf.stroke_rectangle [49, 526], 63, 44
42
40
 
43
- # rectangle
44
- pdf.stroke_rectangle [-14, 526], 63, 44
41
+ # rectangle
42
+ pdf.stroke_rectangle [-14, 526], 63, 44
45
43
 
46
- # rectangle
47
- pdf.stroke_rectangle [429, 431], 24, 18
44
+ # rectangle
45
+ pdf.stroke_rectangle [429, 431], 24, 18
48
46
 
49
- # rectangle
50
- pdf.stroke_rectangle [165, 431], 59, 18
47
+ # rectangle
48
+
49
+ pdf.stroke_rectangle [165, 431], 59, 18
51
50
 
52
- # rectangle
53
- pdf.stroke_rectangle [213, 424], 9, 9
51
+ # rectangle
52
+ pdf.stroke_rectangle [213, 424], 9, 9
54
53
 
55
- # rectangle
56
- pdf.stroke_rectangle [364, 613], 186, 18
54
+ # rectangle
55
+ pdf.stroke_rectangle [364, 613], 186, 18
57
56
 
58
- # rectangle
59
- pdf.stroke_rectangle [175, 613], 189, 18
57
+ # rectangle
58
+ pdf.stroke_rectangle [175, 613], 189, 18
60
59
 
61
- # rectangle
62
- pdf.stroke_rectangle [328, 673], 222, 18
60
+ # rectangle
61
+ pdf.stroke_rectangle [328, 673], 222, 18
63
62
 
64
- # rectangle
65
- pdf.stroke_rectangle [328, 697], 222, 24
63
+ # rectangle
64
+ pdf.stroke_rectangle [328, 697], 222, 24
66
65
 
67
- # rectangle
68
- pdf.stroke_rectangle [264, 697], 64, 66
66
+ # rectangle
67
+ pdf.stroke_rectangle [264, 697], 64, 66
69
68
 
70
- # rectangle
71
- pdf.stroke_rectangle [312, 668], 9, 10
69
+ # rectangle
70
+ pdf.stroke_rectangle [312, 668], 9, 10
72
71
 
73
- # rectangle
74
- pdf.stroke_rectangle [-14, 431], 179, 18
72
+ # rectangle
73
+ pdf.stroke_rectangle [-14, 431], 179, 18
75
74
 
76
- # rectangle
77
- pdf.stroke_rectangle [-14, 475], 134, 18
75
+ # rectangle
76
+ pdf.stroke_rectangle [-14, 475], 134, 18
78
77
 
79
- # rectangle
80
- pdf.stroke_rectangle [-14, 457], 91, 18
78
+ # rectangle
79
+ pdf.stroke_rectangle [-14, 457], 91, 18
81
80
 
82
- # rectangle
83
- pdf.stroke_rectangle [-14, 587], 373, 20
81
+ # rectangle
82
+ pdf.stroke_rectangle [-14, 587], 373, 20
84
83
 
85
- # rectangle
86
- pdf.stroke_rectangle [224, 431], 75, 18
84
+ # rectangle
85
+ pdf.stroke_rectangle [224, 431], 75, 18
87
86
 
88
- # rectangle
89
- pdf.stroke_rectangle [119, 475], 115, 18
87
+ # rectangle
88
+ pdf.stroke_rectangle [119, 475], 115, 18
90
89
 
91
- # rectangle
92
- pdf.stroke_rectangle [233, 475], 115, 18
90
+ # rectangle
91
+ pdf.stroke_rectangle [233, 475], 115, 18
93
92
 
94
- # rectangle
95
- pdf.stroke_rectangle [347, 475], 97, 18
93
+ # rectangle
94
+ pdf.stroke_rectangle [347, 475], 97, 18
96
95
 
97
- # rectangle
98
- pdf.stroke_rectangle [443, 475], 107, 18
96
+ # rectangle
97
+ pdf.stroke_rectangle [443, 475], 107, 18
99
98
 
100
- # rectangle
101
- pdf.stroke_rectangle [-14, 568], 305, 18
99
+ # rectangle
100
+ pdf.stroke_rectangle [-14, 568], 305, 18
102
101
 
103
- # rectangle
104
- pdf.stroke_rectangle [471, 587], 79, 20
102
+ # rectangle
103
+ pdf.stroke_rectangle [471, 587], 79, 20
105
104
 
106
- # rectangle
107
- pdf.stroke_rectangle [358, 587], 113, 20
105
+ # rectangle
106
+ pdf.stroke_rectangle [358, 587], 113, 20
108
107
 
109
- # rectangle
110
- pdf.stroke_rectangle [290, 568], 125, 18
108
+ # rectangle
109
+ pdf.stroke_rectangle [290, 568], 125, 18
111
110
 
112
- # rectangle
113
- pdf.stroke_rectangle [414, 568], 57, 18
111
+ # rectangle
112
+ pdf.stroke_rectangle [414, 568], 57, 18
114
113
 
115
- # rectangle
116
- pdf.stroke_rectangle [213, 551], 111, 18
114
+ # rectangle
115
+ pdf.stroke_rectangle [213, 551], 111, 18
117
116
 
118
- # rectangle
119
- pdf.stroke_rectangle [323, 551], 32, 18
117
+ # rectangle
118
+ pdf.stroke_rectangle [323, 551], 32, 18
120
119
 
121
- # rectangle
122
- pdf.stroke_rectangle [471, 568], 79, 18
120
+ # rectangle
121
+ pdf.stroke_rectangle [471, 568], 79, 18
123
122
 
124
- # rectangle
125
- pdf.stroke_rectangle [471, 551], 79, 18
123
+ # rectangle
124
+ pdf.stroke_rectangle [471, 551], 79, 18
126
125
 
127
- # rectangle
128
- pdf.stroke_rectangle [354, 551], 117, 18
126
+ # rectangle
127
+ pdf.stroke_rectangle [354, 551], 117, 18
129
128
 
130
- # rectangle
131
- pdf.stroke_rectangle [-14, 551], 228, 18
129
+ # rectangle
130
+ pdf.stroke_rectangle [-14, 551], 228, 18
132
131
 
133
- # rectangle
134
- pdf.stroke_rectangle [255, 457], 92, 18
132
+ # rectangle
133
+ pdf.stroke_rectangle [255, 457], 92, 18
135
134
 
136
- # rectangle
137
- pdf.stroke_rectangle [76, 457], 90, 18
135
+ # rectangle
136
+ pdf.stroke_rectangle [76, 457], 90, 18
138
137
 
139
- # rectangle
140
- pdf.stroke_rectangle [165, 457], 90, 18
138
+ # rectangle
139
+ pdf.stroke_rectangle [165, 457], 90, 18
141
140
 
142
- # rectangle
143
- pdf.stroke_rectangle [443, 457], 107, 18
141
+ # rectangle
142
+ pdf.stroke_rectangle [443, 457], 107, 18
144
143
 
145
- # rectangle
146
- pdf.stroke_rectangle [298, 431], 131, 18
144
+ # rectangle
145
+ pdf.stroke_rectangle [298, 431], 131, 18
147
146
 
148
- # rectangle
149
- pdf.stroke_rectangle [245, 413], 185, 18
147
+ # rectangle
148
+ pdf.stroke_rectangle [245, 413], 185, 18
150
149
 
151
- # rectangle
152
- pdf.stroke_rectangle [453, 431], 97, 18
150
+ # rectangle
151
+ pdf.stroke_rectangle [453, 431], 97, 18
153
152
 
154
- # rectangle
155
- pdf.stroke_rectangle [-14, 413], 260, 18
153
+ # rectangle
154
+ pdf.stroke_rectangle [-14, 413], 260, 18
156
155
 
157
- # rectangle
158
- pdf.stroke_rectangle [-14, 395], 67, 18
156
+ # rectangle
157
+ pdf.stroke_rectangle [-14, 395], 67, 18
159
158
 
160
- # rectangle
161
- pdf.stroke_rectangle [53, 395], 117, 18
159
+ # rectangle
160
+ pdf.stroke_rectangle [53, 395], 117, 18
162
161
 
163
- # rectangle
164
- pdf.stroke_rectangle [170, 395], 107, 18
162
+ # rectangle
163
+ pdf.stroke_rectangle [170, 395], 107, 18
165
164
 
166
- # rectangle
167
- pdf.stroke_rectangle [277, 395], 109, 18
165
+ # rectangle
166
+ pdf.stroke_rectangle [277, 395], 109, 18
168
167
 
169
- # rectangle
170
- pdf.stroke_rectangle [429, 413], 24, 18
168
+ # rectangle
169
+ pdf.stroke_rectangle [429, 413], 24, 18
171
170
 
172
- # rectangle
173
- pdf.stroke_rectangle [453, 413], 97, 18
171
+ # rectangle
172
+ pdf.stroke_rectangle [453, 413], 97, 18
174
173
 
175
- # rectangle
176
- pdf.stroke_rectangle [386, 395], 81, 18
174
+ # rectangle
175
+ pdf.stroke_rectangle [386, 395], 81, 18
177
176
 
178
- # rectangle
179
- pdf.stroke_rectangle [467, 395], 83, 18
177
+ # rectangle
178
+ pdf.stroke_rectangle [467, 395], 83, 18
180
179
 
181
- # rectangle
182
- pdf.stroke_rectangle [-14, 631], 342, 18
180
+ # rectangle
181
+ pdf.stroke_rectangle [-14, 631], 342, 18
183
182
 
184
- # rectangle
185
- pdf.stroke_rectangle [-14, 613], 189, 18
183
+ # rectangle
184
+ pdf.stroke_rectangle [-14, 613], 189, 18
186
185
 
187
- # rectangle
188
- pdf.stroke_rectangle [-14, 749], 457, 20
186
+ # rectangle
187
+ pdf.stroke_rectangle [-14, 749], 457, 20
189
188
 
190
- # rectangle
191
- pdf.stroke_rectangle [-14, 729], 74, 17
189
+ # rectangle
190
+ pdf.stroke_rectangle [-14, 729], 74, 17
192
191
 
193
- # rectangle
194
- pdf.stroke_rectangle [60, 729], 383, 17
192
+ # rectangle
193
+ pdf.stroke_rectangle [60, 729], 383, 17
195
194
 
196
- # rectangle
197
- pdf.stroke_rectangle [175, 526], 63, 44
195
+ # rectangle
196
+ pdf.stroke_rectangle [175, 526], 63, 44
198
197
 
199
- # rectangle
200
- pdf.stroke_rectangle [238, 526], 63, 44
198
+ # rectangle
199
+ pdf.stroke_rectangle [238, 526], 63, 44
201
200
 
202
- # rectangle
203
- pdf.stroke_rectangle [301, 526], 63, 44
201
+ # rectangle
202
+ pdf.stroke_rectangle [301, 526], 63, 44
204
203
 
205
- # rectangle
206
- pdf.stroke_rectangle [364, 526], 63, 44
204
+ # rectangle
205
+ pdf.stroke_rectangle [364, 526], 63, 44
207
206
 
208
- # rectangle
209
- pdf.stroke_rectangle [427, 526], 63, 44
207
+ # rectangle
208
+ pdf.stroke_rectangle [427, 526], 63, 44
210
209
 
211
- # rectangle
212
- pdf.stroke_rectangle [490, 526], 60, 44
210
+ # rectangle
211
+ pdf.stroke_rectangle [490, 526], 60, 44
213
212
 
214
- # rectangle
215
- pdf.stroke_rectangle [-14, 367], 564, 213
213
+ # rectangle
214
+ pdf.stroke_rectangle [-14, 367], 564, 213
216
215
 
217
- # rectangle
218
- pdf.stroke_rectangle [-14, 117], 341, 173
216
+ # rectangle
217
+ pdf.stroke_rectangle [-14, 117], 341, 173
219
218
 
220
- # rectangle
221
- pdf.stroke_rectangle [327, 117], 223, 173
219
+ # rectangle
220
+ pdf.stroke_rectangle [327, 117], 223, 173
222
221
 
223
- # rectangle
224
- pdf.stroke_rectangle [-14, 146], 112, 20
222
+ # rectangle
223
+ pdf.stroke_rectangle [-14, 146], 112, 20
225
224
 
226
- # rectangle
227
- pdf.stroke_rectangle [97, 146], 145, 20
225
+ # rectangle
226
+ pdf.stroke_rectangle [97, 146], 145, 20
228
227
 
229
- # rectangle
230
- pdf.stroke_rectangle [241, 146], 145, 20
228
+ # rectangle
229
+ pdf.stroke_rectangle [241, 146], 145, 20
231
230
 
232
- # rectangle
233
- pdf.stroke_rectangle [385, 146], 165, 20
231
+ # rectangle
232
+ pdf.stroke_rectangle [385, 146], 165, 20
234
233
 
235
- # staticText
236
- pdf.draw_text "PROTOCOLO DE AUTORIZAÇÃO DE USO", :size => 5, :at => [332, 626], :width => 142, :height => 7
234
+ # staticText
235
+ pdf.draw_text "PROTOCOLO DE AUTORIZAÇÃO DE USO", :size => 5, :at => [332, 626], :width => 142, :height => 7
237
236
 
238
- # textField xml['infProt/nProt'] + ' ' + xml['infProt/dhRecbto']
239
- pdf.draw_text xml['infProt/nProt'] + ' ' + xml['infProt/dhRecbto'], :size => 6, :at => [333, 617], :width => 215, :height => 9
237
+ # textField xml['infProt/nProt'] + ' ' + xml['infProt/dhRecbto']
238
+ pdf.draw_text xml['infProt/nProt'] + ' ' + xml['infProt/dhRecbto'], :size => 6, :at => [333, 617], :width => 215, :height => 9
240
239
 
241
- # staticText
242
- pdf.draw_text "Consulta de autenticidade no portal nacional da NF-e www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora", :size => 6, :at => [330, 638], :width => 218, :height => 17
240
+ # staticText
241
+ pdf.draw_text "Consulta de autenticidade no portal nacional da NF-e www.nfe.fazenda.gov.br/portal ou no site da Sefaz Autorizadora", :size => 6, :at => [330, 638], :width => 218, :height => 17
243
242
 
244
- # staticText
245
- pdf.draw_text "N°.", :size => 7, :at => [446, 728], :width => 9, :height => 9
243
+ # staticText
244
+ pdf.draw_text "N°.", :size => 7, :at => [446, 728], :width => 9, :height => 9
246
245
 
247
- # staticText
248
- pdf.draw_text "DESTINATÁRIO / REMETENTE", :size => 5, :at => [-14, 591], :width => 109, :height => 8
246
+ # staticText
247
+ pdf.draw_text "DESTINATÁRIO / REMETENTE", :size => 5, :at => [-14, 591], :width => 109, :height => 8
249
248
 
250
- # staticText
251
- pdf.draw_text "CNPJ/CPF", :size => 5, :at => [361, 582], :width => 46, :height => 7
249
+ # staticText
250
+ pdf.draw_text "CNPJ/CPF", :size => 5, :at => [361, 582], :width => 46, :height => 7
252
251
 
253
- # staticText
254
- pdf.draw_text "DATA DA EMISSÃO", :size => 5, :at => [474, 582], :width => 49, :height => 7
252
+ # staticText
253
+ pdf.draw_text "DATA DA EMISSÃO", :size => 5, :at => [474, 582], :width => 49, :height => 7
255
254
 
256
- # staticText
257
- pdf.draw_text "NOME/RAZÃO SOCIAL", :size => 5, :at => [-11, 582], :width => 107, :height => 7
255
+ # staticText
256
+ pdf.draw_text "NOME/RAZÃO SOCIAL", :size => 5, :at => [-11, 582], :width => 107, :height => 7
258
257
 
259
- # staticText
260
- pdf.draw_text "ENDEREÇO", :size => 5, :at => [-11, 563], :width => 107, :height => 7
258
+ # staticText
259
+ pdf.draw_text "ENDEREÇO", :size => 5, :at => [-11, 563], :width => 107, :height => 7
261
260
 
262
- # staticText
263
- pdf.draw_text "BAIRRO / DISTRITO", :size => 5, :at => [293, 563], :width => 69, :height => 7
261
+ # staticText
262
+ pdf.draw_text "BAIRRO / DISTRITO", :size => 5, :at => [293, 563], :width => 69, :height => 7
264
263
 
265
- # staticText
266
- pdf.draw_text "CEP", :size => 5, :at => [415, 563], :width => 30, :height => 7
264
+ # staticText
265
+ pdf.draw_text "CEP", :size => 5, :at => [415, 563], :width => 30, :height => 7
267
266
 
268
- # staticText
269
- pdf.draw_text "FONE/FAX", :size => 5, :at => [217, 546], :width => 49, :height => 7
267
+ # staticText
268
+ pdf.draw_text "FONE/FAX", :size => 5, :at => [217, 546], :width => 49, :height => 7
270
269
 
271
- # staticText
272
- pdf.draw_text "UF", :size => 5, :at => [326, 546], :width => 17, :height => 7
270
+ # staticText
271
+ pdf.draw_text "UF", :size => 5, :at => [326, 546], :width => 17, :height => 7
273
272
 
274
- # staticText
275
- pdf.draw_text "FATURA / DUPLICATAS", :size => 5, :at => [-14, 530], :width => 109, :height => 7
273
+ # staticText
274
+ pdf.draw_text "FATURA / DUPLICATAS", :size => 5, :at => [-14, 530], :width => 109, :height => 7
276
275
 
277
- # staticText
278
- pdf.draw_text "CÁLCULO DO IMPOSTO", :size => 5, :at => [-14, 479], :width => 109, :height => 7
276
+ # staticText
277
+ pdf.draw_text "CÁLCULO DO IMPOSTO", :size => 5, :at => [-14, 479], :width => 109, :height => 7
279
278
 
280
- # staticText
281
- pdf.draw_text "BASE DE CÁLCULO DO ICMS", :size => 5, :at => [-11, 470], :width => 73, :height => 7
279
+ # staticText
280
+ pdf.draw_text "BASE DE CÁLCULO DO ICMS", :size => 5, :at => [-11, 470], :width => 73, :height => 7
282
281
 
283
- # staticText
284
- pdf.draw_text "VALOR DO ICMS", :size => 5, :at => [122, 470], :width => 78, :height => 7
282
+ # staticText
283
+ pdf.draw_text "VALOR DO ICMS", :size => 5, :at => [122, 470], :width => 78, :height => 7
285
284
 
286
- # staticText
287
- pdf.draw_text "BASE DE CÁLCULO DO ICMS ST", :size => 5, :at => [236, 470], :width => 80, :height => 7
285
+ # staticText
286
+ pdf.draw_text "BASE DE CÁLCULO DO ICMS ST", :size => 5, :at => [236, 470], :width => 80, :height => 7
288
287
 
289
- # staticText
290
- pdf.draw_text "VALOR DO ICMS ST", :size => 5, :at => [350, 470], :width => 59, :height => 7
288
+ # staticText
289
+ pdf.draw_text "VALOR DO ICMS ST", :size => 5, :at => [350, 470], :width => 59, :height => 7
291
290
 
292
- # staticText
293
- pdf.draw_text "VALOR TOTAL DOS PRODUTOS", :size => 5, :at => [446, 470], :width => 79, :height => 7
291
+ # staticText
292
+ pdf.draw_text "VALOR TOTAL DOS PRODUTOS", :size => 5, :at => [446, 470], :width => 79, :height => 7
294
293
 
295
- # staticText
296
- pdf.draw_text "TRANSPORTADOR / VOLUMES TRANSPORTADOS DADOS DO PRODUTO / SERVIÇODADOS DO PRODUTO / SERVIÇODADOS DO PRODUTO / SERVIÇO", :size => 5, :at => [-14, 435], :width => 134, :height => 8
294
+ # staticText
295
+ pdf.draw_text "TRANSPORTADOR / VOLUMES TRANSPORTADOS DADOS DO PRODUTO / SERVIÇODADOS DO PRODUTO / SERVIÇODADOS DO PRODUTO / SERVIÇO", :size => 5, :at => [-14, 435], :width => 134, :height => 8
297
296
 
298
- # staticText
299
- pdf.draw_text "RAZÃO SOCIAL", :size => 5, :at => [-11, 426], :width => 64, :height => 7
297
+ # staticText
298
+ pdf.draw_text "RAZÃO SOCIAL", :size => 5, :at => [-11, 426], :width => 64, :height => 7
300
299
 
301
- # staticText
302
- pdf.draw_text "FRETE POR CONTA", :size => 5, :at => [167, 426], :width => 49, :height => 7
300
+ # staticText
301
+ pdf.draw_text "FRETE POR CONTA", :size => 5, :at => [167, 426], :width => 49, :height => 7
303
302
 
304
- # staticText
305
- pdf.draw_text "CÓDIGO ANTT", :size => 5, :at => [227, 426], :width => 49, :height => 7
303
+ # staticText
304
+ pdf.draw_text "CÓDIGO ANTT", :size => 5, :at => [227, 426], :width => 49, :height => 7
306
305
 
307
- # staticText
308
- pdf.draw_text "0-EMITENTE 1-DESTINATÁRIO", :size => 4, :at => [167, 416], :width => 44, :height => 12
306
+ # staticText
307
+ pdf.draw_text "0-EMITENTE 1-DESTINATÁRIO", :size => 4, :at => [167, 416], :width => 44, :height => 12
309
308
 
310
- # textField dest/xNome
311
- pdf.draw_text xml['dest/xNome'], :size => 7, :at => [-11, 572], :width => 366, :height => 9
309
+ # textField dest/xNome
310
+ pdf.draw_text xml['dest/xNome'], :size => 7, :at => [-11, 572], :width => 366, :height => 9
312
311
 
313
- # textField enderDest/xLgr enderDest/nro
314
- pdf.draw_text xml['enderDest/xLgr'] + " " + xml['enderDest/nro'], :size => 7, :at => [-11, 555], :width => 298, :height => 9
312
+ # textField enderDest/xLgr enderDest/nro
313
+ pdf.draw_text xml['enderDest/xLgr'] + " " + xml['enderDest/nro'], :size => 7, :at => [-11, 555], :width => 298, :height => 9
315
314
 
316
- # textField dest/CNPJ
317
- pdf.draw_text xml['dest/CNPJ'], :size => 7, :at => [361, 572], :width => 107, :height => 9
315
+ # textField dest/CNPJ
316
+ pdf.draw_text xml['dest/CNPJ'], :size => 7, :at => [361, 572], :width => 107, :height => 9
318
317
 
319
- # textField ide/dEmi
320
- pdf.draw_text xml['ide/dEmi'], :size => 7, :at => [474, 572], :width => 74, :height => 9
318
+ # textField ide/dEmi
319
+ pdf.draw_text xml['ide/dEmi'], :size => 7, :at => [474, 572], :width => 74, :height => 9
321
320
 
322
- # textField enderDest/xBairro
323
- pdf.draw_text xml['enderDest/xBairro'], :size => 7, :at => [293, 555], :width => 119, :height => 9
321
+ # textField enderDest/xBairro
322
+ pdf.draw_text xml['enderDest/xBairro'], :size => 7, :at => [293, 555], :width => 119, :height => 9
324
323
 
325
- # textField enderDest/CEP
326
- pdf.draw_text xml['enderDest/CEP'], :size => 7, :at => [415, 555], :width => 55, :height => 9
324
+ # textField enderDest/CEP
325
+ pdf.draw_text xml['enderDest/CEP'], :size => 7, :at => [415, 555], :width => 55, :height => 9
327
326
 
328
- # textField enderDest/UF
329
- pdf.draw_text xml['enderDest/UF'], :size => 7, :at => [326, 537], :width => 26, :height => 9
327
+ # textField enderDest/UF
328
+ pdf.draw_text xml['enderDest/UF'], :size => 7, :at => [326, 537], :width => 26, :height => 9
330
329
 
331
- # textField enderDest/fone
332
- pdf.draw_text xml['enderDest/fone'], :size => 7, :at => [217, 537], :width => 104, :height => 9
330
+ # textField enderDest/fone
331
+ pdf.draw_text xml['enderDest/fone'], :size => 7, :at => [217, 537], :width => 104, :height => 9
333
332
 
334
- # textField total/vBC
335
- pdf.draw_text xml['total/vBC'], :size => 7, :at => [-11, 461], :width => 127, :height => 9
333
+ # textField total/vBC
334
+ pdf.draw_text xml['total/vBC'], :size => 7, :at => [-11, 461], :width => 127, :height => 9
336
335
 
337
- # textField total/vICMS
338
- pdf.draw_text xml['total/vICMS'], :size => 7, :at => [122, 461], :width => 108, :height => 9
336
+ # textField total/vICMS
337
+ pdf.draw_text xml['total/vICMS'], :size => 7, :at => [122, 461], :width => 108, :height => 9
339
338
 
340
- # textField total/vBCST
341
- pdf.draw_text xml['total/vBCST'], :size => 7, :at => [236, 461], :width => 108, :height => 9
339
+ # textField total/vBCST
340
+ pdf.draw_text xml['total/vBCST'], :size => 7, :at => [236, 461], :width => 108, :height => 9
342
341
 
343
- # textField total/vST
344
- pdf.draw_text xml['total/vST'], :size => 7, :at => [350, 461], :width => 90, :height => 9
342
+ # textField total/vST
343
+ pdf.draw_text xml['total/vST'], :size => 7, :at => [350, 461], :width => 90, :height => 9
345
344
 
346
- # textField total/vProd
347
- pdf.draw_text xml['total/vProd'], :size => 7, :at => [446, 461], :width => 101, :height => 9
345
+ # textField total/vProd
346
+ pdf.draw_text xml['total/vProd'], :size => 7, :at => [446, 461], :width => 101, :height => 9
348
347
 
349
- # textField transporta/xNome
350
- pdf.draw_text xml['transporta/xNome'], :size => 7, :at => [-11, 417], :width => 174, :height => 9
348
+ # textField transporta/xNome
349
+ pdf.draw_text xml['transporta/xNome'], :size => 7, :at => [-11, 417], :width => 174, :height => 9
351
350
 
352
- # textField transp/modFrete
353
- pdf.draw_text xml['transp/modFrete'], :size => 5, :at => [214, 420], :width => 7, :height => 7
351
+ # textField transp/modFrete
352
+ pdf.draw_text xml['transp/modFrete'], :size => 5, :at => [214, 420], :width => 7, :height => 7
354
353
 
355
- # textField veicTransp/RNTC
356
- pdf.draw_text xml['veicTransp/RNTC'], :size => 5, :at => [227, 417], :width => 69, :height => 9
354
+ # textField veicTransp/RNTC
355
+ pdf.draw_text xml['veicTransp/RNTC'], :size => 5, :at => [227, 417], :width => 69, :height => 9
357
356
 
358
- # staticText DATA DA SAÍDA/ENTRADA
359
- pdf.draw_text "DATA DA SAÍDA/ENTRADA", :size => 5, :at => [474, 563], :width => 69, :height => 7
357
+ # staticText DATA DA SAÍDA/ENTRADA
358
+ pdf.draw_text "DATA DA SAÍDA/ENTRADA", :size => 5, :at => [474, 563], :width => 69, :height => 7
360
359
 
361
- # staticText HORA DE SAÍDA
362
- pdf.draw_text "HORA DE SAÍDA", :size => 5, :at => [474, 546], :width => 53, :height => 7
360
+ # staticText HORA DE SAÍDA
361
+ pdf.draw_text "HORA DE SAÍDA", :size => 5, :at => [474, 546], :width => 53, :height => 7
363
362
 
364
- # staticText INSCRIÇÃO ESTADUAL
365
- pdf.draw_text "INSCRIÇÃO ESTADUAL", :size => 5, :at => [357, 546], :width => 79, :height => 7
363
+ # staticText INSCRIÇÃO ESTADUAL
364
+ pdf.draw_text "INSCRIÇÃO ESTADUAL", :size => 5, :at => [357, 546], :width => 79, :height => 7
366
365
 
367
- # textField $F{NR_IE_DESTINO}
368
- pdf.draw_text xml['dest/IE'], :size => 7, :at => [357, 537], :width => 111, :height => 9
366
+ # textField $F{NR_IE_DESTINO}
367
+ pdf.draw_text xml['dest/IE'], :size => 7, :at => [357, 537], :width => 111, :height => 9
369
368
 
370
- # textField $F{DS_MUNICIPIO_DESTINO}
371
- pdf.draw_text xml['enderDest/xMun'], :size => 7, :at => [-11, 537], :width => 222, :height => 9
369
+ # textField $F{DS_MUNICIPIO_DESTINO}
370
+ pdf.draw_text xml['enderDest/xMun'], :size => 7, :at => [-11, 537], :width => 222, :height => 9
372
371
 
373
- # staticText MUNICÍPIO
374
- pdf.draw_text "MUNICÍPIO", :size => 5, :at => [-11, 546], :width => 107, :height => 7
372
+ # staticText MUNICÍPIO
373
+ pdf.draw_text "MUNICÍPIO", :size => 5, :at => [-11, 546], :width => 107, :height => 7
375
374
 
376
- # staticText Número
377
- pdf.draw_text "Número", :size => 5, :at => [-11, 522], :width => 57, :height => 7
375
+ # staticText Número
376
+ pdf.draw_text "Número", :size => 5, :at => [-11, 522], :width => 57, :height => 7
378
377
 
379
- # staticText Vencimento
380
- pdf.draw_text "Vencimento", :size => 5, :at => [53, 522], :width => 56, :height => 7
378
+ # staticText Vencimento
379
+ pdf.draw_text "Vencimento", :size => 5, :at => [53, 522], :width => 56, :height => 7
381
380
 
382
- # staticText Valor
383
- pdf.draw_text "Valor", :size => 5, :at => [116, 522], :width => 55, :height => 7
381
+ # staticText Valor
382
+ pdf.draw_text "Valor", :size => 5, :at => [116, 522], :width => 55, :height => 7
384
383
 
385
- # textField $F{VL_OUTROS}
386
- pdf.draw_text xml['total/vOutros'], :size => 7, :at => [258, 443], :width => 86, :height => 9
384
+ # textField $F{VL_OUTROS}
385
+ pdf.draw_text xml['total/vOutros'], :size => 7, :at => [258, 443], :width => 86, :height => 9
387
386
 
388
- # staticText OUTRAS DESPESAS ACESSÓRIAS
389
- pdf.draw_text "OUTRAS DESPESAS ACESSÓRIAS", :size => 5, :at => [258, 452], :width => 84, :height => 7
387
+ # staticText OUTRAS DESPESAS ACESSÓRIAS
388
+ pdf.draw_text "OUTRAS DESPESAS ACESSÓRIAS", :size => 5, :at => [258, 452], :width => 84, :height => 7
390
389
 
391
- # textField $F{VL_SEGURO}
392
- pdf.draw_text xml['total/vSeg'], :size => 7, :at => [79, 443], :width => 83, :height => 9
390
+ # textField $F{VL_SEGURO}
391
+ pdf.draw_text xml['total/vSeg'], :size => 7, :at => [79, 443], :width => 83, :height => 9
393
392
 
394
- # staticText VALOR DO SEGURO
395
- pdf.draw_text "VALOR DO SEGURO", :size => 5, :at => [79, 452], :width => 59, :height => 7
393
+ # staticText VALOR DO SEGURO
394
+ pdf.draw_text "VALOR DO SEGURO", :size => 5, :at => [79, 452], :width => 59, :height => 7
396
395
 
397
- # staticText DESCONTO
398
- pdf.draw_text "DESCONTO", :size => 5, :at => [168, 452], :width => 35, :height => 7
396
+ # staticText DESCONTO
397
+ pdf.draw_text "DESCONTO", :size => 5, :at => [168, 452], :width => 35, :height => 7
399
398
 
400
- # textField $F{VL_DESCONTO}
401
- pdf.draw_text xml['total/vDesc'], :size => 7, :at => [168, 443], :width => 85, :height => 9
399
+ # textField $F{VL_DESCONTO}
400
+ pdf.draw_text xml['total/vDesc'], :size => 7, :at => [168, 443], :width => 85, :height => 9
402
401
 
403
- # staticText VALOR DO FRETE
404
- pdf.draw_text "VALOR DO FRETE", :size => 5, :at => [-11, 452], :width => 50, :height => 7
402
+ # staticText VALOR DO FRETE
403
+ pdf.draw_text "VALOR DO FRETE", :size => 5, :at => [-11, 452], :width => 50, :height => 7
405
404
 
406
- # textField $F{VL_FRETE}
407
- pdf.draw_text xml['total/vlFrete'], :size => 7, :at => [-11, 443], :width => 84, :height => 9
405
+ # textField $F{VL_FRETE}
406
+ pdf.draw_text xml['total/vlFrete'], :size => 7, :at => [-11, 443], :width => 84, :height => 9
408
407
 
409
- # textField $F{VL_NF}
410
- pdf.draw_text xml['total/vNF'], :size => 7, :at => [447, 443], :width => 99, :height => 9
408
+ # textField $F{VL_NF}
409
+ pdf.draw_text xml['total/vNF'], :size => 7, :at => [447, 443], :width => 99, :height => 9
411
410
 
412
- # staticText VALOR TOTAL DA NOTA
413
- pdf.draw_text "VALOR TOTAL DA NOTA", :size => 5, :at => [447, 452], :width => 61, :height => 7
411
+ # staticText VALOR TOTAL DA NOTA
412
+ pdf.draw_text "VALOR TOTAL DA NOTA", :size => 5, :at => [447, 452], :width => 61, :height => 7
414
413
 
415
- # staticText PLACA DO VEÍCULO
416
- pdf.draw_text "PLACA DO VEÍCULO", :size => 5, :at => [301, 426], :width => 69, :height => 7
414
+ # staticText PLACA DO VEÍCULO
415
+ pdf.draw_text "PLACA DO VEÍCULO", :size => 5, :at => [301, 426], :width => 69, :height => 7
417
416
 
418
- # staticText CNPJ / CPF
419
- pdf.draw_text "CNPJ / CPF", :size => 5, :at => [455, 426], :width => 69, :height => 7
417
+ # staticText CNPJ / CPF
418
+ pdf.draw_text "CNPJ / CPF", :size => 5, :at => [455, 426], :width => 69, :height => 7
420
419
 
421
- # textField transporta/CNPJ
422
- pdf.draw_text xml['transporta/CNPJ'], :size => 7, :at => [455, 417], :width => 92, :height => 9
420
+ # textField transporta/CNPJ
421
+ pdf.draw_text xml['transporta/CNPJ'], :size => 7, :at => [455, 417], :width => 92, :height => 9
423
422
 
424
- # textField transporta/xMun
425
- pdf.draw_text xml['transporta/xMun'], :size => 7, :at => [249, 399], :width => 177, :height => 10
423
+ # textField transporta/xMun
424
+ pdf.draw_text xml['transporta/xMun'], :size => 7, :at => [249, 399], :width => 177, :height => 10
426
425
 
427
- # staticText
428
- pdf.draw_text "MUNICÍPIO", :size => 5, :at => [249, 408], :width => 64, :height => 7
426
+ # staticText
427
+ pdf.draw_text "MUNICÍPIO", :size => 5, :at => [249, 408], :width => 64, :height => 7
429
428
 
430
- # textField transporta/xEnder
431
- pdf.draw_text xml['transporta/xEnder'], :size => 7, :at => [-11, 399], :width => 255, :height => 9
429
+ # textField transporta/xEnder
430
+ pdf.draw_text xml['transporta/xEnder'], :size => 7, :at => [-11, 399], :width => 255, :height => 9
432
431
 
433
- # staticText
434
- pdf.draw_text "ENDEREÇO", :size => 5, :at => [-11, 408], :width => 64, :height => 7
432
+ # staticText
433
+ pdf.draw_text "ENDEREÇO", :size => 5, :at => [-11, 408], :width => 64, :height => 7
435
434
 
436
- # staticText
437
- pdf.draw_text "QUANTIDADE", :size => 5, :at => [-11, 390], :width => 39, :height => 7
435
+ # staticText
436
+ pdf.draw_text "QUANTIDADE", :size => 5, :at => [-11, 390], :width => 39, :height => 7
438
437
 
439
- # textField vol/qVol
440
- pdf.draw_text xml['vol/qVol'], :size => 7, :at => [-11, 381], :width => 60, :height => 9
438
+ # textField vol/qVol
439
+ pdf.draw_text xml['vol/qVol'], :size => 7, :at => [-11, 381], :width => 60, :height => 9
441
440
 
442
- # textField vol/esp
443
- pdf.draw_text xml['vol/esp'], :size => 7, :at => [56, 381], :width => 111, :height => 9
441
+ # textField vol/esp
442
+ pdf.draw_text xml['vol/esp'], :size => 7, :at => [56, 381], :width => 111, :height => 9
444
443
 
445
- # staticText
446
- pdf.draw_text "ESPÉCIE", :size => 5, :at => [56, 390], :width => 29, :height => 7
444
+ # staticText
445
+ pdf.draw_text "ESPÉCIE", :size => 5, :at => [56, 390], :width => 29, :height => 7
447
446
 
448
- # staticText
449
- pdf.draw_text "MARCA", :size => 5, :at => [173, 390], :width => 62, :height => 7
447
+ # staticText
448
+ pdf.draw_text "MARCA", :size => 5, :at => [173, 390], :width => 62, :height => 7
450
449
 
451
- # textField vol/marca
452
- pdf.draw_text xml['vol/marca'], :size => 7, :at => [173, 381], :width => 97, :height => 9
450
+ # textField vol/marca
451
+ pdf.draw_text xml['vol/marca'], :size => 7, :at => [173, 381], :width => 97, :height => 9
453
452
 
454
- # staticText
455
- pdf.draw_text "NUMERAÇÃO", :size => 5, :at => [280, 390], :width => 62, :height => 7
453
+ # staticText
454
+ pdf.draw_text "NUMERAÇÃO", :size => 5, :at => [280, 390], :width => 62, :height => 7
456
455
 
457
- # textField
458
- pdf.draw_text "", :size => 7, :at => [280, 381], :width => 103, :height => 9
456
+ # textField
457
+ pdf.draw_text "", :size => 7, :at => [280, 381], :width => 103, :height => 9
459
458
 
460
- # staticText UF
461
- pdf.draw_text "UF", :size => 5, :at => [432, 408], :width => 14, :height => 7
459
+ # staticText UF
460
+ pdf.draw_text "UF", :size => 5, :at => [432, 408], :width => 14, :height => 7
462
461
 
463
- # textField tranporta/UF
464
- pdf.draw_text xml['tranporta/UF'], :size => 7, :at => [432, 399], :width => 19, :height => 9
462
+ # textField tranporta/UF
463
+ pdf.draw_text xml['tranporta/UF'], :size => 7, :at => [432, 399], :width => 19, :height => 9
465
464
 
466
- # textField transporta/IE
467
- pdf.draw_text xml['transporta/IE'], :size => 7, :at => [456, 399], :width => 91, :height => 9
465
+ # textField transporta/IE
466
+ pdf.draw_text xml['transporta/IE'], :size => 7, :at => [456, 399], :width => 91, :height => 9
468
467
 
469
- # staticText
470
- pdf.draw_text "INSCRIÇÃO ESTADUAL", :size => 5, :at => [456, 408], :width => 69, :height => 7
468
+ # staticText
469
+ pdf.draw_text "INSCRIÇÃO ESTADUAL", :size => 5, :at => [456, 408], :width => 69, :height => 7
471
470
 
472
- # staticText
473
- pdf.draw_text "PESO BRUTO", :size => 5, :at => [389, 390], :width => 76, :height => 7
471
+ # staticText
472
+ pdf.draw_text "PESO BRUTO", :size => 5, :at => [389, 390], :width => 76, :height => 7
474
473
 
475
- # textField vol/pesoB
476
- pdf.draw_text xml['vol/pesoB'], :size => 7, :at => [389, 381], :width => 76, :height => 9
474
+ # textField vol/pesoB
475
+ pdf.draw_text xml['vol/pesoB'], :size => 7, :at => [389, 381], :width => 76, :height => 9
477
476
 
478
- # textField 'vol/pesoL'
479
- pdf.draw_text xml['vol/pesoL'], :size => 7, :at => [470, 381], :width => 77, :height => 9
477
+ # textField 'vol/pesoL'
478
+ pdf.draw_text xml['vol/pesoL'], :size => 7, :at => [470, 381], :width => 77, :height => 9
480
479
 
481
- # staticText
482
- pdf.draw_text "PESO LÍQUIDO", :size => 5, :at => [470, 390], :width => 76, :height => 7
480
+ # staticText
481
+ pdf.draw_text "PESO LÍQUIDO", :size => 5, :at => [470, 390], :width => 76, :height => 7
483
482
 
484
- # textField transp/pĺaca
485
- pdf.draw_text xml['transp/pĺaca'], :size => 7, :at => [301, 417], :width => 125, :height => 9
483
+ # textField transp/pĺaca
484
+ pdf.draw_text xml['transp/pĺaca'], :size => 7, :at => [301, 417], :width => 125, :height => 9
486
485
 
487
- # staticText UF
488
- pdf.draw_text "UF", :size => 5, :at => [432, 426], :width => 8, :height => 7
486
+ # staticText UF
487
+ pdf.draw_text "UF", :size => 5, :at => [432, 426], :width => 8, :height => 7
489
488
 
490
- # textField transp/UF
491
- pdf.draw_text xml['transp/UF'], :size => 7, :at => [432, 417], :width => 18, :height => 9
489
+ # textField transp/UF
490
+ pdf.draw_text xml['transp/UF'], :size => 7, :at => [432, 417], :width => 18, :height => 9
492
491
 
493
- # staticText
494
- pdf.draw_text "VALOR DO IPI", :size => 5, :at => [350, 452], :width => 43, :height => 7
492
+ # staticText
493
+ pdf.draw_text "VALOR DO IPI", :size => 5, :at => [350, 452], :width => 43, :height => 7
495
494
 
496
- # textField total/vIPI
497
- pdf.draw_text xml['total/vIPI'], :size => 7, :at => [350, 443], :width => 90, :height => 9
495
+ # textField total/vIPI
496
+ pdf.draw_text xml['total/vIPI'], :size => 7, :at => [350, 443], :width => 90, :height => 9
498
497
 
499
- # staticText
500
- pdf.draw_text "DANFE", :size => 10, :at => [267, 689], :width => 58, :height => 12
498
+ # staticText
499
+ pdf.draw_text "DANFE", :size => 10, :at => [267, 689], :width => 58, :height => 12
501
500
 
502
- # staticText
503
- pdf.draw_text "DOCUMENTO AUXILIAR DA NOTA FISCAL ELETRÔNICA", :size => 5, :at => [266, 675], :width => 60, :height => 17
501
+ # staticText
502
+ pdf.draw_text "DOCUMENTO AUXILIAR DA NOTA FISCAL ELETRÔNICA", :size => 5, :at => [266, 675], :width => 60, :height => 17
504
503
 
505
- # staticText
506
- pdf.draw_text "0 - ENTRADA 1 - SAÍDA", :size => 5, :at => [272, 659], :width => 34, :height => 14
504
+ # staticText
505
+ pdf.draw_text "0 - ENTRADA 1 - SAÍDA", :size => 5, :at => [272, 659], :width => 34, :height => 14
507
506
 
508
- # staticText
509
- pdf.draw_text "NATUREZA DA OPERAÇÃO", :size => 5, :at => [-11, 626], :width => 107, :height => 7
507
+ # staticText
508
+ pdf.draw_text "NATUREZA DA OPERAÇÃO", :size => 5, :at => [-11, 626], :width => 107, :height => 7
510
509
 
511
- # staticText
512
- pdf.draw_text "INSCRIÇÃO ESTADUAL", :size => 5, :at => [-11, 608], :width => 69, :height => 7
510
+ # staticText
511
+ pdf.draw_text "INSCRIÇÃO ESTADUAL", :size => 5, :at => [-11, 608], :width => 69, :height => 7
513
512
 
514
- # staticText
515
- pdf.draw_text "INSC.ESTADUAL DO SUBST. TRIBUTÁRIO", :size => 5, :at => [178, 608], :width => 107, :height => 7
513
+ # staticText
514
+ pdf.draw_text "INSC.ESTADUAL DO SUBST. TRIBUTÁRIO", :size => 5, :at => [178, 608], :width => 107, :height => 7
516
515
 
517
- # staticText
518
- pdf.draw_text "CNPJ", :size => 5, :at => [367, 608], :width => 16, :height => 7
516
+ # staticText
517
+ pdf.draw_text "CNPJ", :size => 5, :at => [367, 608], :width => 16, :height => 7
519
518
 
520
- # textField ide/natOp
521
- pdf.draw_text xml['ide/natOp'], :size => 7, :at => [-11, 617], :width => 336, :height => 9
519
+ # textField ide/natOp
520
+ pdf.draw_text xml['ide/natOp'], :size => 7, :at => [-11, 617], :width => 336, :height => 9
522
521
 
523
- # textField emit/IE
524
- pdf.draw_text xml['emit/IE'], :size => 7, :at => [-11, 599], :width => 183, :height => 9
522
+ # textField emit/IE
523
+ pdf.draw_text xml['emit/IE'], :size => 7, :at => [-11, 599], :width => 183, :height => 9
525
524
 
526
- # textField emit/IE_ST
527
- pdf.draw_text xml['emit/IE_ST'], :size => 7, :at => [178, 599], :width => 183, :height => 9
525
+ # textField emit/IE_ST
526
+ pdf.draw_text xml['emit/IE_ST'], :size => 7, :at => [178, 599], :width => 183, :height => 9
528
527
 
529
- # textField emit/CNPJ
530
- pdf.draw_text xml['emit/CNPJ'], :size => 7, :at => [367, 599], :width => 181, :height => 9
528
+ # textField emit/CNPJ
529
+ pdf.draw_text xml['emit/CNPJ'], :size => 7, :at => [367, 599], :width => 181, :height => 9
531
530
 
532
- # textField ide/dSaiEnt
533
- pdf.draw_text xml['ide/dSaiEnt'], :size => 5, :at => [314, 664], :width => 5, :height => 6
531
+ # textField ide/dSaiEnt
532
+ pdf.draw_text xml['ide/dSaiEnt'], :size => 5, :at => [314, 664], :width => 5, :height => 6
534
533
 
535
- # textField ide/serie
536
- pdf.draw_text xml['ide/serie'], :size => 6, :at => [287, 643], :width => 38, :height => 7
534
+ # textField ide/serie
535
+ pdf.draw_text xml['ide/serie'], :size => 6, :at => [287, 643], :width => 38, :height => 7
537
536
 
538
- # staticText
539
- pdf.draw_text "SÉRIE", :size => 6, :at => [268, 643], :width => 19, :height => 7
537
+ # staticText
538
+ pdf.draw_text "SÉRIE", :size => 6, :at => [268, 643], :width => 19, :height => 7
540
539
 
541
- # textField ide/nNF
542
- pdf.draw_text xml['ide/nNF'], :size => 7, :at => [277, 650], :width => 48, :height => 9
540
+ # textField ide/nNF
541
+ pdf.draw_text xml['ide/nNF'], :size => 7, :at => [277, 650], :width => 48, :height => 9
543
542
 
544
- # staticText
545
- pdf.draw_text "DATA DE RECEBIMENTO", :size => 5, :at => [-11, 724], :width => 65, :height => 7
543
+ # staticText
544
+ pdf.draw_text "DATA DE RECEBIMENTO", :size => 5, :at => [-11, 724], :width => 65, :height => 7
546
545
 
547
- # staticText
548
- pdf.draw_text "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR", :size => 5, :at => [63, 724], :width => 259, :height => 7
546
+ # staticText
547
+ pdf.draw_text "IDENTIFICAÇÃO E ASSINATURA DO RECEBEDOR", :size => 5, :at => [63, 724], :width => 259, :height => 7
549
548
 
550
- # staticText
551
- pdf.draw_text "NF-e", :size => 9, :at => [446, 738], :width => 102, :height => 12
549
+ # staticText
550
+ pdf.draw_text "NF-e", :size => 9, :at => [446, 738], :width => 102, :height => 12
552
551
 
553
- # textField ide/serie
554
- pdf.draw_text xml['ide/serie'], :size => 7, :at => [472, 719], :width => 76, :height => 9
552
+ # textField ide/serie
553
+ pdf.draw_text xml['ide/serie'], :size => 7, :at => [472, 719], :width => 76, :height => 9
555
554
 
556
- # textField ide/nNF
557
- pdf.draw_text xml['ide/nNF'], :size => 7, :at => [455, 728], :width => 93, :height => 9
555
+ # textField ide/nNF
556
+ pdf.draw_text xml['ide/nNF'], :size => 7, :at => [455, 728], :width => 93, :height => 9
558
557
 
559
- # textField
560
- pdf.draw_text "RECEBEMOS DE " + xml['emit/xNome'] + " OS PRODUTOS CONSTANTES DA NOTA FISCAL INDICADA A BAIXO", :size => 5, :at => [-11, 744], :width => 450, :height => 8
558
+ # textField
559
+ pdf.draw_text "RECEBEMOS DE " + xml['emit/xNome'] + " OS PRODUTOS CONSTANTES DA NOTA FISCAL INDICADA A BAIXO", :size => 5, :at => [-11, 744], :width => 450, :height => 8
561
560
 
562
- # staticText
563
- pdf.draw_text "SÉRIE", :size => 7, :at => [446, 719], :width => 26, :height => 9
561
+ # staticText
562
+ pdf.draw_text "SÉRIE", :size => 7, :at => [446, 719], :width => 26, :height => 9
564
563
 
565
- # staticText
566
- pdf.draw_text "CHAVE DE ACESSO", :size => 5, :at => [331, 668], :width => 67, :height => 7
564
+ # staticText
565
+ pdf.draw_text "CHAVE DE ACESSO", :size => 5, :at => [331, 668], :width => 67, :height => 7
567
566
 
568
- # staticText
569
- pdf.draw_text "FOLHA", :size => 6, :at => [268, 636], :width => 19, :height => 7
567
+ # staticText
568
+ pdf.draw_text "FOLHA", :size => 6, :at => [268, 636], :width => 19, :height => 7
570
569
 
571
- # textField
572
- pdf.draw_text " 1 / 1", :size => 6, :at => [287, 636], :width => 9, :height => 7
570
+ # textField
571
+ pdf.draw_text " 1 / 1", :size => 6, :at => [287, 636], :width => 9, :height => 7
573
572
 
574
- # textField chNFe
575
- pdf.draw_text xml['chNFe'], :size => 6, :at => [331, 659], :width => 217, :height => 9
573
+ # textField chNFe
574
+ pdf.draw_text xml['chNFe'], :size => 6, :at => [331, 659], :width => 217, :height => 9
576
575
 
577
- # staticText
578
- pdf.draw_text "DADOS DO PRODUTO / SERVIÇO", :size => 5, :at => [-14, 372], :width => 134, :height => 8
576
+ # staticText
577
+ pdf.draw_text "DADOS DO PRODUTO / SERVIÇO", :size => 5, :at => [-14, 372], :width => 134, :height => 8
579
578
 
580
- # staticText
581
- pdf.draw_text "N°", :size => 7, :at => [268, 650], :width => 10, :height => 9
579
+ # staticText
580
+ pdf.draw_text "N°", :size => 7, :at => [268, 650], :width => 10, :height => 9
582
581
 
583
- # textField emit/xNome
584
- pdf.draw_text xml['emit/xNome'], :size => 7, :at => [62, 680], :width => 198, :height => 21
582
+ # textField emit/xNome
583
+ pdf.draw_text xml['emit/xNome'], :size => 7, :at => [62, 680], :width => 198, :height => 21
585
584
 
586
- # textField enderEmit/xLgr enderEmit/nro
587
- pdf.draw_text xml['enderEmit/xLgr'] + ", " + xml['enderEmit/nro'], :size => 7, :at => [62, 669], :width => 198, :height => 10
585
+ # textField enderEmit/xLgr enderEmit/nro
586
+ pdf.draw_text xml['enderEmit/xLgr'] + ", " + xml['enderEmit/nro'], :size => 7, :at => [62, 669], :width => 198, :height => 10
588
587
 
589
- # textField enderEmit/xBairro
590
- pdf.draw_text xml['enderEmit/xBairro'] + " - " + xml['enderEmit/CEP'], :size => 7, :at => [62, 659], :width => 198, :height => 10
588
+ # textField enderEmit/xBairro
589
+ pdf.draw_text xml['enderEmit/xBairro'] + " - " + xml['enderEmit/CEP'], :size => 7, :at => [62, 659], :width => 198, :height => 10
591
590
 
592
- # textField enderEmit/xMun enderEmit/UF
593
- pdf.draw_text xml['enderEmit/xMun'] + "/" + xml['enderEmit/UF'], :size => 6, :at => [62, 649], :width => 198, :height => 10
591
+ # textField enderEmit/xMun enderEmit/UF
592
+ pdf.draw_text xml['enderEmit/xMun'] + "/" + xml['enderEmit/UF'], :size => 6, :at => [62, 649], :width => 198, :height => 10
594
593
 
595
- # textField enderEmit/fone enderEmit/email
596
- pdf.draw_text xml['enderEmit/fone'] + " " + xml['enderEmit/email'], :size => 6, :at => [62, 639], :width => 198, :height => 10
594
+ # textField enderEmit/fone enderEmit/email
595
+ pdf.draw_text xml['enderEmit/fone'] + " " + xml['enderEmit/email'], :size => 6, :at => [62, 639], :width => 198, :height => 10
597
596
 
598
- # textField ide/dSaiEnt
599
- pdf.draw_text xml['ide/dSaiEnt'], :size => 7, :at => [474, 555], :width => 74, :height => 9
597
+ # textField ide/dSaiEnt
598
+ pdf.draw_text xml['ide/dSaiEnt'], :size => 7, :at => [474, 555], :width => 74, :height => 9
600
599
 
601
- # textField ide/dSaiEnt
602
- pdf.draw_text xml['ide/dSaiEnt'], :size => 7, :at => [474, 537], :width => 74, :height => 9
600
+ # textField ide/dSaiEnt
601
+ pdf.draw_text xml['ide/dSaiEnt'], :size => 7, :at => [474, 537], :width => 74, :height => 9
603
602
 
604
- # staticText
605
- pdf.draw_text "Número", :size => 5, :at => [178, 522], :width => 57, :height => 7
603
+ # staticText
604
+ pdf.draw_text "Número", :size => 5, :at => [178, 522], :width => 57, :height => 7
606
605
 
607
- # staticText
608
- pdf.draw_text "Vencimento", :size => 5, :at => [242, 522], :width => 56, :height => 7
606
+ # staticText
607
+ pdf.draw_text "Vencimento", :size => 5, :at => [242, 522], :width => 56, :height => 7
609
608
 
610
- # staticText
611
- pdf.draw_text "Valor", :size => 5, :at => [305, 522], :width => 55, :height => 7
609
+ # staticText
610
+ pdf.draw_text "Valor", :size => 5, :at => [305, 522], :width => 55, :height => 7
612
611
 
613
- # staticText
614
- pdf.draw_text "Número", :size => 5, :at => [367, 522], :width => 57, :height => 7
612
+ # staticText
613
+ pdf.draw_text "Número", :size => 5, :at => [367, 522], :width => 57, :height => 7
615
614
 
616
- # staticText
617
- pdf.draw_text "Vencimento", :size => 5, :at => [431, 522], :width => 56, :height => 7
615
+ # staticText
616
+ pdf.draw_text "Vencimento", :size => 5, :at => [431, 522], :width => 56, :height => 7
618
617
 
619
- # staticText
620
- pdf.draw_text "Valor", :size => 5, :at => [494, 522], :width => 50, :height => 7
618
+ # staticText
619
+ pdf.draw_text "Valor", :size => 5, :at => [494, 522], :width => 50, :height => 7
621
620
 
622
- # textField infAdic/infCpl
623
- pdf.draw_text xml['infAdic/infCpl'], :size => 6, :at => [-10, -50], :width => 334, :height => 161
621
+ # textField infAdic/infCpl
622
+ pdf.draw_text xml['infAdic/infCpl'], :size => 6, :at => [-10, -50], :width => 334, :height => 161
624
623
 
625
- # staticText
626
- pdf.draw_text "DADOS ADICIONAIS", :size => 5, :at => [-14, 121], :width => 134, :height => 7
624
+ # staticText
625
+ pdf.draw_text "DADOS ADICIONAIS", :size => 5, :at => [-14, 121], :width => 134, :height => 7
627
626
 
628
- # staticText
629
- pdf.draw_text "CÁLCULO DO ISSQN", :size => 5, :at => [-14, 150], :width => 134, :height => 8
627
+ # staticText
628
+ pdf.draw_text "CÁLCULO DO ISSQN", :size => 5, :at => [-14, 150], :width => 134, :height => 8
630
629
 
631
- # staticText
632
- pdf.draw_text "INSCRIÇÃO MUNICIPAL", :size => 5, :at => [-11, 141], :width => 83, :height => 8
630
+ # staticText
631
+ pdf.draw_text "INSCRIÇÃO MUNICIPAL", :size => 5, :at => [-11, 141], :width => 83, :height => 8
633
632
 
634
- # staticText
635
- pdf.draw_text "VALOR TOTAL DOS SERVIÇOS", :size => 5, :at => [100, 141], :width => 103, :height => 8
633
+ # staticText
634
+ pdf.draw_text "VALOR TOTAL DOS SERVIÇOS", :size => 5, :at => [100, 141], :width => 103, :height => 8
636
635
 
637
- # textField total/vServ
638
- pdf.draw_text xml['total/vServ'], :size => 7, :at => [100, 130], :width => 138, :height => 10
636
+ # textField total/vServ
637
+ pdf.draw_text xml['total/vServ'], :size => 7, :at => [100, 130], :width => 138, :height => 10
639
638
 
640
- # textField emit/IM
641
- pdf.draw_text xml['emit/IM'], :size => 7, :at => [-11, 130], :width => 105, :height => 10
639
+ # textField emit/IM
640
+ pdf.draw_text xml['emit/IM'], :size => 7, :at => [-11, 130], :width => 105, :height => 10
642
641
 
643
- # staticText
644
- pdf.draw_text "BASE DE CÁLCULO DO ISSQN", :size => 5, :at => [244, 141], :width => 103, :height => 8
642
+ # staticText
643
+ pdf.draw_text "BASE DE CÁLCULO DO ISSQN", :size => 5, :at => [244, 141], :width => 103, :height => 8
645
644
 
646
- # textField total/vBCISS
647
- pdf.draw_text xml['total/vBCISS'], :size => 7, :at => [244, 130], :width => 138, :height => 10
645
+ # textField total/vBCISS
646
+ pdf.draw_text xml['total/vBCISS'], :size => 7, :at => [244, 130], :width => 138, :height => 10
648
647
 
649
- # staticText
650
- pdf.draw_text "VALOR DO ISSQN", :size => 5, :at => [388, 141], :width => 103, :height => 8
648
+ # staticText
649
+ pdf.draw_text "VALOR DO ISSQN", :size => 5, :at => [388, 141], :width => 103, :height => 8
651
650
 
652
- # textField total/ISSTot
653
- pdf.draw_text xml['total/ISSTot'], :size => 7, :at => [388, 130], :width => 159, :height => 10
651
+ # textField total/ISSTot
652
+ pdf.draw_text xml['total/ISSTot'], :size => 7, :at => [388, 130], :width => 159, :height => 10
654
653
 
655
- # textField
656
- pdf.draw_text "", :size => 6, :at => [331, -50], :width => 216, :height => 163
654
+ # textField
655
+ pdf.draw_text "", :size => 6, :at => [331, -50], :width => 216, :height => 163
657
656
 
658
- # staticText
659
- pdf.draw_text "RESERVADO AO FISCO", :size => 5, :at => [331, 113], :width => 96, :height => 7
657
+ # staticText
658
+ pdf.draw_text "RESERVADO AO FISCO", :size => 5, :at => [331, 113], :width => 96, :height => 7
660
659
 
661
- # staticText
662
- pdf.draw_text "INFORMAÇÕES COMPLEMENTARES", :size => 5, :at => [-11, 112], :width => 93, :height => 7
660
+ # staticText
661
+ pdf.draw_text "INFORMAÇÕES COMPLEMENTARES", :size => 5, :at => [-11, 112], :width => 93, :height => 7
663
662
 
664
- end
665
-
663
+ return pdf
664
+
665
+ end
666
+
667
+ def self.render(xml_string)
668
+ xml = XML.new(xml_string)
669
+ pdf = generatePDFFromXML(xml)
670
+ return pdf.render
671
+ end
672
+
673
+ def self.generate(pdf_filename, xml_filename)
674
+ xml = XML.new(File.new(xml_filename))
675
+ pdf = generatePDFFromXML(xml)
676
+ pdf.render_file pdf_filename
666
677
  end
667
678
 
668
679
  end
data/ruby_danfe.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ruby_danfe'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.3'
4
4
  s.summary = "DANFE generator for Brazilian NFE."
5
5
  s.authors = ["Eduardo Rebouças"]
6
6
  s.email = 'eduardo.reboucas@gmail.com'
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_danfe
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Eduardo Rebou\xC3\xA7as"