br_danfe 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,18 +1,29 @@
1
1
  module BrDanfe
2
2
  class Transp
3
- def self.render(pdf, xml)
4
- pdf.ititle 0.42, 10.00, 0.25, 14.48, "transporta.title"
3
+ Y = 14.47 + SPACE_BETWEEN_GROUPS
5
4
 
6
- pdf.lbox 0.85, 9.02, 0.25, 14.90, xml, "transporta/xNome"
7
- pdf.ibox 0.85, 2.79, 9.27, 14.90, I18n.t("danfe.transp.modFrete.title"), xml["transp/modFrete"] == "0" ? I18n.t("danfe.transp.modFrete.emitter") : I18n.t("danfe.transp.modFrete.recipient")
8
- pdf.lbox 0.85, 1.78, 12.06, 14.90, xml, "veicTransp/RNTC"
9
- pdf.ibox 0.85, 2.29, 13.84, 14.90, I18n.t("danfe.veicTransp.placa"), Plate.format(xml["veicTransp/placa"])
10
- pdf.lbox 0.85, 0.76, 16.13, 14.90, xml, "veicTransp/UF"
11
- pdf.lbox 0.85, 3.94, 16.89, 14.90, xml, "transporta/CNPJ"
12
- pdf.lbox 0.85, 9.02, 0.25, 15.75, xml, "transporta/xEnder"
13
- pdf.lbox 0.85, 6.86, 9.27, 15.75, xml, "transporta/xMun"
14
- pdf.lbox 0.85, 0.76, 16.13, 15.75, xml, "transporta/UF"
15
- pdf.lbox 0.85, 3.94, 16.89, 15.75, xml, "transporta/IE"
5
+ def initialize(pdf, xml)
6
+ @pdf = pdf
7
+ @xml = xml
8
+
9
+ @ltitle = Y - 0.42
10
+ @l1 = Y
11
+ @l2 = Y + LINE_HEIGHT
12
+ end
13
+
14
+ def render
15
+ @pdf.ititle 0.42, 10.00, 0.25, @ltitle, "transporta.title"
16
+
17
+ @pdf.lbox LINE_HEIGHT, 9.02, 0.25, @l1, @xml, "transporta/xNome"
18
+ @pdf.ibox LINE_HEIGHT, 2.79, 9.27, @l1, I18n.t("danfe.transp.modFrete.title"), @xml["transp/modFrete"] == "0" ? I18n.t("danfe.transp.modFrete.emitter") : I18n.t("danfe.transp.modFrete.recipient")
19
+ @pdf.lbox LINE_HEIGHT, 1.78, 12.06, @l1, @xml, "veicTransp/RNTC"
20
+ @pdf.ibox LINE_HEIGHT, 2.29, 13.84, @l1, I18n.t("danfe.veicTransp.placa"), Plate.format(@xml["veicTransp/placa"])
21
+ @pdf.lbox LINE_HEIGHT, 0.76, 16.13, @l1, @xml, "veicTransp/UF"
22
+ @pdf.lbox LINE_HEIGHT, 3.94, 16.89, @l1, @xml, "transporta/CNPJ"
23
+ @pdf.lbox LINE_HEIGHT, 9.02, 0.25, @l2, @xml, "transporta/xEnder"
24
+ @pdf.lbox LINE_HEIGHT, 6.86, 9.27, @l2, @xml, "transporta/xMun"
25
+ @pdf.lbox LINE_HEIGHT, 0.76, 16.13, @l2, @xml, "transporta/UF"
26
+ @pdf.lbox LINE_HEIGHT, 3.94, 16.89, @l2, @xml, "transporta/IE"
16
27
  end
17
28
  end
18
29
  end
@@ -1,3 +1,3 @@
1
1
  module BrDanfe
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/br_danfe/vol.rb CHANGED
@@ -1,8 +1,12 @@
1
1
  module BrDanfe
2
2
  class Vol
3
+ Y = 16.59
4
+
3
5
  def initialize(pdf, xml)
4
6
  @pdf = pdf
5
7
  @xml = xml
8
+
9
+ @l1 = Y
6
10
  end
7
11
 
8
12
  def render
@@ -18,12 +22,12 @@ module BrDanfe
18
22
 
19
23
  private
20
24
  def render_vol(det)
21
- @pdf.ibox 0.85, 2.92, 0.25, 16.60, I18n.t("danfe.vol.qVol"), det.css("qVol").text
22
- @pdf.ibox 0.85, 3.05, 3.17, 16.60, I18n.t("danfe.vol.esp"), det.css("esp").text
23
- @pdf.ibox 0.85, 3.05, 6.22, 16.60, I18n.t("danfe.vol.marca"), det.css("marca").text
24
- @pdf.ibox 0.85, 4.83, 9.27, 16.60, I18n.t("danfe.vol.nVol")
25
- @pdf.inumeric 0.85, 3.43, 14.10, 16.60, "vol.pesoB", det.css("pesoB").text, { decimals: 3 }
26
- @pdf.inumeric 0.85, 3.30, 17.53, 16.60, "vol.pesoL", det.css("pesoL").text, { decimals: 3 }
25
+ @pdf.ibox 0.85, 2.92, 0.25, @l1, I18n.t("danfe.vol.qVol"), det.css("qVol").text
26
+ @pdf.ibox 0.85, 3.05, 3.17, @l1, I18n.t("danfe.vol.esp"), det.css("esp").text
27
+ @pdf.ibox 0.85, 3.05, 6.22, @l1, I18n.t("danfe.vol.marca"), det.css("marca").text
28
+ @pdf.ibox 0.85, 4.83, 9.27, @l1, I18n.t("danfe.vol.nVol")
29
+ @pdf.inumeric 0.85, 3.43, 14.10, @l1, "vol.pesoB", det.css("pesoB").text, { decimals: 3 }
30
+ @pdf.inumeric 0.85, 3.30, 17.53, @l1, "vol.pesoL", det.css("pesoL").text, { decimals: 3 }
27
31
  end
28
32
  end
29
33
  end
@@ -0,0 +1,271 @@
1
+ %PDF-1.3
2
+ %����
3
+ 1 0 obj
4
+ << /Creator <feff0050007200610077006e>
5
+ /Producer <feff0050007200610077006e>
6
+ >>
7
+ endobj
8
+ 2 0 obj
9
+ << /Type /Catalog
10
+ /Pages 3 0 R
11
+ >>
12
+ endobj
13
+ 3 0 obj
14
+ << /Type /Pages
15
+ /Count 1
16
+ /Kids [5 0 R]
17
+ >>
18
+ endobj
19
+ 4 0 obj
20
+ << /Length 2848
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 7.086614173228347 608.772220472441 Td
28
+ /F2.0 8 Tf
29
+ [<44455354494e> 20 <41> 95 <54> 90 <c152494f202f2052454d4554454e5445>] TJ
30
+ ET
31
+
32
+ 7.087 583.654 349.228 22.677 re
33
+ S
34
+
35
+ BT
36
+ 9.086614173228348 600.2327086614175 Td
37
+ /F1.0 6 Tf
38
+ [<4e4f4d452f52415ac3> 55 <4f20534f4349414c>] TJ
39
+ ET
40
+
41
+
42
+ BT
43
+ 9.086614173228348 586.5007086614174 Td
44
+ /F1.0 10 Tf
45
+ [<5363686e656964657220456c6563747269632042726173696c204c746461>] TJ
46
+ ET
47
+
48
+ 356.315 583.654 138.047 22.677 re
49
+ S
50
+
51
+ BT
52
+ 358.3149606299213 600.2327086614175 Td
53
+ /F1.0 6 Tf
54
+ [<434e504a2f435046>] TJ
55
+ ET
56
+
57
+
58
+ BT
59
+ 358.3149606299213 586.5007086614174 Td
60
+ /F1.0 10 Tf
61
+ [<38322e3734332e3238372f303030382d3830>] TJ
62
+ ET
63
+
64
+ 7.087 560.976 288.000 22.677 re
65
+ S
66
+
67
+ BT
68
+ 9.086614173228348 577.5555433070867 Td
69
+ /F1.0 6 Tf
70
+ [<454e44455245c74f>] TJ
71
+ ET
72
+
73
+
74
+ BT
75
+ 9.086614173228348 563.8235433070867 Td
76
+ /F1.0 10 Tf
77
+ [<41> 74 <7620646120536175646164652031313235>] TJ
78
+ ET
79
+
80
+ 295.087 560.976 136.913 22.677 re
81
+ S
82
+
83
+ BT
84
+ 297.0866141732284 577.5555433070867 Td
85
+ /F1.0 6 Tf
86
+ [<42> 35 <41495252> 40 <4f>] TJ
87
+ ET
88
+
89
+
90
+ BT
91
+ 297.0866141732284 563.8235433070867 Td
92
+ /F1.0 10 Tf
93
+ [<46727574616c>] TJ
94
+ ET
95
+
96
+ 432.000 560.976 62.362 22.677 re
97
+ S
98
+
99
+ BT
100
+ 434.00000000000006 577.5555433070867 Td
101
+ /F1.0 6 Tf
102
+ [<434550>] TJ
103
+ ET
104
+
105
+
106
+ BT
107
+ 434.00000000000006 563.8235433070867 Td
108
+ /F1.0 10 Tf
109
+ [<31332e3137312d333230>] TJ
110
+ ET
111
+
112
+ 7.087 538.299 201.543 22.677 re
113
+ S
114
+
115
+ BT
116
+ 9.086614173228348 554.878377952756 Td
117
+ /F1.0 6 Tf
118
+ [<4d554e4943cd50494f>] TJ
119
+ ET
120
+
121
+
122
+ BT
123
+ 9.086614173228348 541.146377952756 Td
124
+ /F1.0 10 Tf
125
+ [<53554d415245>] TJ
126
+ ET
127
+
128
+ 208.630 538.299 115.087 22.677 re
129
+ S
130
+
131
+ BT
132
+ 210.62992125984258 554.878377952756 Td
133
+ /F1.0 6 Tf
134
+ [<464f4e452f46> 74 <4158>] TJ
135
+ ET
136
+
137
+
138
+ BT
139
+ 210.62992125984258 541.146377952756 Td
140
+ /F1.0 10 Tf
141
+ [<2831392920323130342d36333030>] TJ
142
+ ET
143
+
144
+ 323.717 538.299 32.315 22.677 re
145
+ S
146
+
147
+ BT
148
+ 325.71653543307093 554.878377952756 Td
149
+ /F1.0 6 Tf
150
+ [<5546>] TJ
151
+ ET
152
+
153
+
154
+ BT
155
+ 325.71653543307093 541.146377952756 Td
156
+ /F1.0 10 Tf
157
+ [<5350>] TJ
158
+ ET
159
+
160
+ 356.031 538.299 138.331 22.677 re
161
+ S
162
+
163
+ BT
164
+ 358.0314960629922 554.878377952756 Td
165
+ /F1.0 6 Tf
166
+ [<494e53435249c7c3> 55 <4f20455354> 93 <414455> 40 <414c>] TJ
167
+ ET
168
+
169
+
170
+ BT
171
+ 358.0314960629922 541.146377952756 Td
172
+ /F1.0 10 Tf
173
+ [<3637312e3030382e3337352e313130>] TJ
174
+ ET
175
+
176
+ 507.402 583.654 82.772 22.677 re
177
+ S
178
+
179
+ BT
180
+ 509.4015748031497 600.2327086614175 Td
181
+ /F1.0 6 Tf
182
+ [<44> 40 <41> 111 <54> 93 <412044> 40 <4120454d495353c3> 55 <4f>] TJ
183
+ ET
184
+
185
+
186
+ BT
187
+ 542.6132283464567 586.5007086614174 Td
188
+ /F1.0 10 Tf
189
+ [<32392f31302f32303131>] TJ
190
+ ET
191
+
192
+ 507.402 560.976 82.772 22.677 re
193
+ S
194
+
195
+ BT
196
+ 509.4015748031497 577.5555433070867 Td
197
+ /F1.0 6 Tf
198
+ [<44> 40 <41> 111 <54> 93 <412044> 40 <4120454e54524144> 40 <412f5341cd44> 40 <41>] TJ
199
+ ET
200
+
201
+
202
+ BT
203
+ 542.6132283464567 563.8235433070867 Td
204
+ /F1.0 10 Tf
205
+ [<33302f31302f32303131>] TJ
206
+ ET
207
+
208
+ 507.402 538.299 82.772 22.677 re
209
+ S
210
+
211
+ BT
212
+ 509.4015748031497 554.878377952756 Td
213
+ /F1.0 6 Tf
214
+ [<484f524120444520454e54524144> 40 <412f5341cd44> 40 <41>] TJ
215
+ ET
216
+
217
+
218
+ BT
219
+ 552.6132283464567 541.146377952756 Td
220
+ /F1.0 10 Tf
221
+ [<31353a33323a3435>] TJ
222
+ ET
223
+
224
+ Q
225
+
226
+ endstream
227
+ endobj
228
+ 5 0 obj
229
+ << /Type /Page
230
+ /Parent 3 0 R
231
+ /MediaBox [0 0 595.28 841.89]
232
+ /Contents 4 0 R
233
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
234
+ /Font << /F2.0 6 0 R
235
+ /F1.0 7 0 R
236
+ >>
237
+ >>
238
+ >>
239
+ endobj
240
+ 6 0 obj
241
+ << /Type /Font
242
+ /Subtype /Type1
243
+ /BaseFont /Times-Bold
244
+ /Encoding /WinAnsiEncoding
245
+ >>
246
+ endobj
247
+ 7 0 obj
248
+ << /Type /Font
249
+ /Subtype /Type1
250
+ /BaseFont /Times-Roman
251
+ /Encoding /WinAnsiEncoding
252
+ >>
253
+ endobj
254
+ xref
255
+ 0 8
256
+ 0000000000 65535 f
257
+ 0000000015 00000 n
258
+ 0000000109 00000 n
259
+ 0000000158 00000 n
260
+ 0000000215 00000 n
261
+ 0000003115 00000 n
262
+ 0000003307 00000 n
263
+ 0000003405 00000 n
264
+ trailer
265
+ << /Size 8
266
+ /Root 2 0 R
267
+ /Info 1 0 R
268
+ >>
269
+ startxref
270
+ 3504
271
+ %%EOF
@@ -0,0 +1,271 @@
1
+ %PDF-1.3
2
+ %����
3
+ 1 0 obj
4
+ << /Creator <feff0050007200610077006e>
5
+ /Producer <feff0050007200610077006e>
6
+ >>
7
+ endobj
8
+ 2 0 obj
9
+ << /Type /Catalog
10
+ /Pages 3 0 R
11
+ >>
12
+ endobj
13
+ 3 0 obj
14
+ << /Type /Pages
15
+ /Count 1
16
+ /Kids [5 0 R]
17
+ >>
18
+ endobj
19
+ 4 0 obj
20
+ << /Length 2848
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 7.086614173228347 608.772220472441 Td
28
+ /F2.0 8 Tf
29
+ [<44455354494e> 20 <41> 95 <54> 90 <c152494f202f2052454d4554454e5445>] TJ
30
+ ET
31
+
32
+ 7.087 583.654 349.228 22.677 re
33
+ S
34
+
35
+ BT
36
+ 9.086614173228348 600.2327086614175 Td
37
+ /F1.0 6 Tf
38
+ [<4e4f4d452f52415ac3> 55 <4f20534f4349414c>] TJ
39
+ ET
40
+
41
+
42
+ BT
43
+ 9.086614173228348 586.5007086614174 Td
44
+ /F1.0 10 Tf
45
+ [<5363686e656964657220456c6563747269632042726173696c204c746461>] TJ
46
+ ET
47
+
48
+ 356.315 583.654 138.047 22.677 re
49
+ S
50
+
51
+ BT
52
+ 358.3149606299213 600.2327086614175 Td
53
+ /F1.0 6 Tf
54
+ [<434e504a2f435046>] TJ
55
+ ET
56
+
57
+
58
+ BT
59
+ 358.3149606299213 586.5007086614174 Td
60
+ /F1.0 10 Tf
61
+ [<38322e3734332e3238372f303030382d3830>] TJ
62
+ ET
63
+
64
+ 7.087 560.976 288.000 22.677 re
65
+ S
66
+
67
+ BT
68
+ 9.086614173228348 577.5555433070867 Td
69
+ /F1.0 6 Tf
70
+ [<454e44455245c74f>] TJ
71
+ ET
72
+
73
+
74
+ BT
75
+ 9.086614173228348 563.8235433070867 Td
76
+ /F1.0 10 Tf
77
+ [<41> 74 <7620646120536175646164652031313235>] TJ
78
+ ET
79
+
80
+ 295.087 560.976 136.913 22.677 re
81
+ S
82
+
83
+ BT
84
+ 297.0866141732284 577.5555433070867 Td
85
+ /F1.0 6 Tf
86
+ [<42> 35 <41495252> 40 <4f>] TJ
87
+ ET
88
+
89
+
90
+ BT
91
+ 297.0866141732284 563.8235433070867 Td
92
+ /F1.0 10 Tf
93
+ [<46727574616c>] TJ
94
+ ET
95
+
96
+ 432.000 560.976 62.362 22.677 re
97
+ S
98
+
99
+ BT
100
+ 434.00000000000006 577.5555433070867 Td
101
+ /F1.0 6 Tf
102
+ [<434550>] TJ
103
+ ET
104
+
105
+
106
+ BT
107
+ 434.00000000000006 563.8235433070867 Td
108
+ /F1.0 10 Tf
109
+ [<31332e3137312d333230>] TJ
110
+ ET
111
+
112
+ 7.087 538.299 201.543 22.677 re
113
+ S
114
+
115
+ BT
116
+ 9.086614173228348 554.878377952756 Td
117
+ /F1.0 6 Tf
118
+ [<4d554e4943cd50494f>] TJ
119
+ ET
120
+
121
+
122
+ BT
123
+ 9.086614173228348 541.146377952756 Td
124
+ /F1.0 10 Tf
125
+ [<53554d415245>] TJ
126
+ ET
127
+
128
+ 208.630 538.299 115.087 22.677 re
129
+ S
130
+
131
+ BT
132
+ 210.62992125984258 554.878377952756 Td
133
+ /F1.0 6 Tf
134
+ [<464f4e452f46> 74 <4158>] TJ
135
+ ET
136
+
137
+
138
+ BT
139
+ 210.62992125984258 541.146377952756 Td
140
+ /F1.0 10 Tf
141
+ [<2831392920323130342d36333030>] TJ
142
+ ET
143
+
144
+ 323.717 538.299 32.315 22.677 re
145
+ S
146
+
147
+ BT
148
+ 325.71653543307093 554.878377952756 Td
149
+ /F1.0 6 Tf
150
+ [<5546>] TJ
151
+ ET
152
+
153
+
154
+ BT
155
+ 325.71653543307093 541.146377952756 Td
156
+ /F1.0 10 Tf
157
+ [<5350>] TJ
158
+ ET
159
+
160
+ 356.031 538.299 138.331 22.677 re
161
+ S
162
+
163
+ BT
164
+ 358.0314960629922 554.878377952756 Td
165
+ /F1.0 6 Tf
166
+ [<494e53435249c7c3> 55 <4f20455354> 93 <414455> 40 <414c>] TJ
167
+ ET
168
+
169
+
170
+ BT
171
+ 358.0314960629922 541.146377952756 Td
172
+ /F1.0 10 Tf
173
+ [<3637312e3030382e3337352e313130>] TJ
174
+ ET
175
+
176
+ 507.402 583.654 82.772 22.677 re
177
+ S
178
+
179
+ BT
180
+ 509.4015748031497 600.2327086614175 Td
181
+ /F1.0 6 Tf
182
+ [<44> 40 <41> 111 <54> 93 <412044> 40 <4120454d495353c3> 55 <4f>] TJ
183
+ ET
184
+
185
+
186
+ BT
187
+ 542.6132283464567 586.5007086614174 Td
188
+ /F1.0 10 Tf
189
+ [<32392f31302f32303131>] TJ
190
+ ET
191
+
192
+ 507.402 560.976 82.772 22.677 re
193
+ S
194
+
195
+ BT
196
+ 509.4015748031497 577.5555433070867 Td
197
+ /F1.0 6 Tf
198
+ [<44> 40 <41> 111 <54> 93 <412044> 40 <4120454e54524144> 40 <412f5341cd44> 40 <41>] TJ
199
+ ET
200
+
201
+
202
+ BT
203
+ 542.6132283464567 563.8235433070867 Td
204
+ /F1.0 10 Tf
205
+ [<33302f31302f32303131>] TJ
206
+ ET
207
+
208
+ 507.402 538.299 82.772 22.677 re
209
+ S
210
+
211
+ BT
212
+ 509.4015748031497 554.878377952756 Td
213
+ /F1.0 6 Tf
214
+ [<484f524120444520454e54524144> 40 <412f5341cd44> 40 <41>] TJ
215
+ ET
216
+
217
+
218
+ BT
219
+ 552.6132283464567 541.146377952756 Td
220
+ /F1.0 10 Tf
221
+ [<31333a33323a3435>] TJ
222
+ ET
223
+
224
+ Q
225
+
226
+ endstream
227
+ endobj
228
+ 5 0 obj
229
+ << /Type /Page
230
+ /Parent 3 0 R
231
+ /MediaBox [0 0 595.28 841.89]
232
+ /Contents 4 0 R
233
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
234
+ /Font << /F2.0 6 0 R
235
+ /F1.0 7 0 R
236
+ >>
237
+ >>
238
+ >>
239
+ endobj
240
+ 6 0 obj
241
+ << /Type /Font
242
+ /Subtype /Type1
243
+ /BaseFont /Times-Bold
244
+ /Encoding /WinAnsiEncoding
245
+ >>
246
+ endobj
247
+ 7 0 obj
248
+ << /Type /Font
249
+ /Subtype /Type1
250
+ /BaseFont /Times-Roman
251
+ /Encoding /WinAnsiEncoding
252
+ >>
253
+ endobj
254
+ xref
255
+ 0 8
256
+ 0000000000 65535 f
257
+ 0000000015 00000 n
258
+ 0000000109 00000 n
259
+ 0000000158 00000 n
260
+ 0000000215 00000 n
261
+ 0000003115 00000 n
262
+ 0000003307 00000 n
263
+ 0000003405 00000 n
264
+ trailer
265
+ << /Size 8
266
+ /Root 2 0 R
267
+ /Info 1 0 R
268
+ >>
269
+ startxref
270
+ 3504
271
+ %%EOF