br_danfe 0.2.3 → 0.3.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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/README.md +12 -0
  4. data/lib/br_danfe/danfe.rb +4 -1
  5. data/lib/br_danfe/danfe_lib/det_body.rb +6 -5
  6. data/lib/br_danfe/danfe_lib/options.rb +3 -1
  7. data/lib/br_danfe/version.rb +1 -1
  8. data/spec/features/danfe_spec.rb +20 -0
  9. data/spec/fixtures/cce/lib/barcode#render.pdf +511 -0
  10. data/spec/fixtures/cce/lib/correction#render.pdf +100 -0
  11. data/spec/fixtures/cce/lib/document#box.pdf +55 -0
  12. data/spec/fixtures/cce/lib/document#box.with.block.pdf +72 -0
  13. data/spec/fixtures/cce/lib/document#text.align.pdf +70 -0
  14. data/spec/fixtures/cce/lib/document#text.pad.pdf +70 -0
  15. data/spec/fixtures/cce/lib/document#text.simple.pdf +70 -0
  16. data/spec/fixtures/cce/lib/document#text.size.pdf +70 -0
  17. data/spec/fixtures/cce/lib/document#text.style.pdf +70 -0
  18. data/spec/fixtures/cce/lib/footer#render.pdf +114 -0
  19. data/spec/fixtures/cce/lib/header#render.pdf +72 -0
  20. data/spec/fixtures/cce/lib/nfe_key#render.pdf +88 -0
  21. data/spec/fixtures/cce/lib/protocol#render.pdf +88 -0
  22. data/spec/fixtures/cce/v1.00/cce.fixture.pdf +659 -0
  23. data/spec/fixtures/nfe/lib/dest#render-v2.00.pdf +271 -0
  24. data/spec/fixtures/nfe/lib/dest#render-v3.10.pdf +271 -0
  25. data/spec/fixtures/nfe/lib/dest#render-with_cnpj.pdf +201 -0
  26. data/spec/fixtures/nfe/lib/dest#render-with_cpf.pdf +201 -0
  27. data/spec/fixtures/nfe/lib/dest#render-with_ie.pdf +208 -0
  28. data/spec/fixtures/nfe/lib/det_body#render-csosn.pdf +855 -0
  29. data/spec/fixtures/nfe/lib/det_body#render-cst.pdf +512 -0
  30. data/spec/fixtures/nfe/lib/det_body#render-fci.pdf +267 -0
  31. data/spec/fixtures/nfe/lib/det_body#render-icms_st.pdf +267 -0
  32. data/spec/fixtures/nfe/lib/det_body#render-quantity_with_custom_precision.pdf +246 -0
  33. data/spec/fixtures/nfe/lib/det_body#render-unit_price_with_custom_precision.pdf +246 -0
  34. data/spec/fixtures/nfe/lib/det_header#render.pdf +207 -0
  35. data/spec/fixtures/nfe/lib/document#lcnpj-blank.pdf +74 -0
  36. data/spec/fixtures/nfe/lib/document#lcnpj-invalid.pdf +74 -0
  37. data/spec/fixtures/nfe/lib/document#lcnpj-valid.pdf +81 -0
  38. data/spec/fixtures/nfe/lib/document#lie-blank.pdf +74 -0
  39. data/spec/fixtures/nfe/lib/document#lie-invalid.pdf +74 -0
  40. data/spec/fixtures/nfe/lib/document#lie-valid.pdf +81 -0
  41. data/spec/fixtures/nfe/lib/dup#render.pdf +216 -0
  42. data/spec/fixtures/nfe/lib/emit#render.pdf +143 -0
  43. data/spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf +712 -0
  44. data/spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf +650 -0
  45. data/spec/fixtures/nfe/lib/icmstot#render.pdf +255 -0
  46. data/spec/fixtures/nfe/lib/infadic#render-extra_volume.pdf +295 -0
  47. data/spec/fixtures/nfe/lib/infadic#render.pdf +104 -0
  48. data/spec/fixtures/nfe/lib/issqn#render.pdf +143 -0
  49. data/spec/fixtures/nfe/lib/ticket#render.pdf +113 -0
  50. data/spec/fixtures/nfe/lib/transp#render-modfrete_0.pdf +176 -0
  51. data/spec/fixtures/nfe/lib/transp#render-modfrete_1.pdf +176 -0
  52. data/spec/fixtures/nfe/lib/transp#render-modfrete_2.pdf +176 -0
  53. data/spec/fixtures/nfe/lib/transp#render-modfrete_9.pdf +176 -0
  54. data/spec/fixtures/nfe/lib/transp#render.pdf +239 -0
  55. data/spec/fixtures/nfe/lib/vol#render-blank-boxes.pdf +117 -0
  56. data/spec/fixtures/nfe/lib/vol#render.pdf +152 -0
  57. data/spec/fixtures/nfe/v2.00/custom_options.fixture.pdf +1994 -0
  58. data/spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf +1932 -0
  59. data/spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf +5207 -0
  60. data/spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf +1980 -0
  61. data/spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf +5032 -0
  62. data/spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf +2314 -0
  63. data/spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf +2807 -0
  64. data/spec/lib/danfe_lib/det_body_spec.rb +80 -2
  65. data/spec/lib/danfe_lib/options_spec.rb +8 -1
  66. metadata +30 -2
@@ -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 2822
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 21.25984251968504 596.8667086614174 Td
28
+ /F2.0 8 Tf
29
+ [<44455354494e> 20 <41> 95 <54> 90 <c152494f202f2052454d4554454e5445>] TJ
30
+ ET
31
+
32
+ 21.260 571.748 335.055 22.677 re
33
+ S
34
+
35
+ BT
36
+ 23.25984251968504 588.3271968503939 Td
37
+ /F1.0 6 Tf
38
+ [<4e4f4d452f52415ac3> 55 <4f20534f4349414c>] TJ
39
+ ET
40
+
41
+
42
+ BT
43
+ 23.25984251968504 574.5951968503938 Td
44
+ /F1.0 10 Tf
45
+ [<5363686e656964657220456c6563747269632042726173696c204c746461>] TJ
46
+ ET
47
+
48
+ 356.315 571.748 123.874 22.677 re
49
+ S
50
+
51
+ BT
52
+ 358.3149606299213 588.3271968503939 Td
53
+ /F1.0 6 Tf
54
+ [<434e504a2f435046>] TJ
55
+ ET
56
+
57
+
58
+ BT
59
+ 358.3149606299213 574.5951968503938 Td
60
+ /F1.0 10 Tf
61
+ [<38322e3734332e3238372f303030382d3830>] TJ
62
+ ET
63
+
64
+ 21.260 549.071 273.827 22.677 re
65
+ S
66
+
67
+ BT
68
+ 23.25984251968504 565.6500314960631 Td
69
+ /F1.0 6 Tf
70
+ [<454e44455245c74f>] TJ
71
+ ET
72
+
73
+
74
+ BT
75
+ 23.25984251968504 551.918031496063 Td
76
+ /F1.0 10 Tf
77
+ [<41> 74 <7620646120536175646164652031313235>] TJ
78
+ ET
79
+
80
+ 295.087 549.071 122.740 22.677 re
81
+ S
82
+
83
+ BT
84
+ 297.0866141732284 565.6500314960631 Td
85
+ /F1.0 6 Tf
86
+ [<42> 35 <41495252> 40 <4f>] TJ
87
+ ET
88
+
89
+
90
+ BT
91
+ 297.0866141732284 551.918031496063 Td
92
+ /F1.0 10 Tf
93
+ [<46727574616c>] TJ
94
+ ET
95
+
96
+ 417.827 549.071 62.362 22.677 re
97
+ S
98
+
99
+ BT
100
+ 419.82677165354335 565.6500314960631 Td
101
+ /F1.0 6 Tf
102
+ [<434550>] TJ
103
+ ET
104
+
105
+
106
+ BT
107
+ 419.82677165354335 551.918031496063 Td
108
+ /F1.0 10 Tf
109
+ [<31332e3137312d333230>] TJ
110
+ ET
111
+
112
+ 21.260 526.394 187.370 22.677 re
113
+ S
114
+
115
+ BT
116
+ 23.25984251968504 542.9728661417323 Td
117
+ /F1.0 6 Tf
118
+ [<4d554e4943cd50494f>] TJ
119
+ ET
120
+
121
+
122
+ BT
123
+ 23.25984251968504 529.2408661417323 Td
124
+ /F1.0 10 Tf
125
+ [<53554d415245>] TJ
126
+ ET
127
+
128
+ 208.630 526.394 115.087 22.677 re
129
+ S
130
+
131
+ BT
132
+ 210.62992125984258 542.9728661417323 Td
133
+ /F1.0 6 Tf
134
+ [<464f4e452f46> 74 <4158>] TJ
135
+ ET
136
+
137
+
138
+ BT
139
+ 210.62992125984258 529.2408661417323 Td
140
+ /F1.0 10 Tf
141
+ [<2831392920323130342d36333030>] TJ
142
+ ET
143
+
144
+ 323.717 526.394 32.315 22.677 re
145
+ S
146
+
147
+ BT
148
+ 325.71653543307093 542.9728661417323 Td
149
+ /F1.0 6 Tf
150
+ [<5546>] TJ
151
+ ET
152
+
153
+
154
+ BT
155
+ 325.71653543307093 529.2408661417323 Td
156
+ /F1.0 10 Tf
157
+ [<5350>] TJ
158
+ ET
159
+
160
+ 356.031 526.394 124.157 22.677 re
161
+ S
162
+
163
+ BT
164
+ 358.0314960629922 542.9728661417323 Td
165
+ /F1.0 6 Tf
166
+ [<494e53435249c7c3> 55 <4f20455354> 93 <414455> 40 <414c>] TJ
167
+ ET
168
+
169
+
170
+ BT
171
+ 358.0314960629922 529.2408661417323 Td
172
+ /F1.0 10 Tf
173
+ [<3637312e3030382e3337352e313130>] TJ
174
+ ET
175
+
176
+ 493.228 571.748 82.772 22.677 re
177
+ S
178
+
179
+ BT
180
+ 495.228346456693 588.3271968503939 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
+ 528.44 574.5951968503938 Td
188
+ /F1.0 10 Tf
189
+ [<32392f31302f32303131>] TJ
190
+ ET
191
+
192
+ 493.228 549.071 82.772 22.677 re
193
+ S
194
+
195
+ BT
196
+ 495.228346456693 565.6500314960631 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
+ 528.44 551.918031496063 Td
204
+ /F1.0 10 Tf
205
+ [<33302f31302f32303131>] TJ
206
+ ET
207
+
208
+ 493.228 526.394 82.772 22.677 re
209
+ S
210
+
211
+ BT
212
+ 495.228346456693 542.9728661417323 Td
213
+ /F1.0 6 Tf
214
+ [<484f524120444520454e54524144> 40 <412f5341cd44> 40 <41>] TJ
215
+ ET
216
+
217
+
218
+ BT
219
+ 538.44 529.2408661417323 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
+ 0000003089 00000 n
262
+ 0000003281 00000 n
263
+ 0000003379 00000 n
264
+ trailer
265
+ << /Size 8
266
+ /Root 2 0 R
267
+ /Info 1 0 R
268
+ >>
269
+ startxref
270
+ 3478
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 2822
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 21.25984251968504 596.8667086614174 Td
28
+ /F2.0 8 Tf
29
+ [<44455354494e> 20 <41> 95 <54> 90 <c152494f202f2052454d4554454e5445>] TJ
30
+ ET
31
+
32
+ 21.260 571.748 335.055 22.677 re
33
+ S
34
+
35
+ BT
36
+ 23.25984251968504 588.3271968503939 Td
37
+ /F1.0 6 Tf
38
+ [<4e4f4d452f52415ac3> 55 <4f20534f4349414c>] TJ
39
+ ET
40
+
41
+
42
+ BT
43
+ 23.25984251968504 574.5951968503938 Td
44
+ /F1.0 10 Tf
45
+ [<5363686e656964657220456c6563747269632042726173696c204c746461>] TJ
46
+ ET
47
+
48
+ 356.315 571.748 123.874 22.677 re
49
+ S
50
+
51
+ BT
52
+ 358.3149606299213 588.3271968503939 Td
53
+ /F1.0 6 Tf
54
+ [<434e504a2f435046>] TJ
55
+ ET
56
+
57
+
58
+ BT
59
+ 358.3149606299213 574.5951968503938 Td
60
+ /F1.0 10 Tf
61
+ [<38322e3734332e3238372f303030382d3830>] TJ
62
+ ET
63
+
64
+ 21.260 549.071 273.827 22.677 re
65
+ S
66
+
67
+ BT
68
+ 23.25984251968504 565.6500314960631 Td
69
+ /F1.0 6 Tf
70
+ [<454e44455245c74f>] TJ
71
+ ET
72
+
73
+
74
+ BT
75
+ 23.25984251968504 551.918031496063 Td
76
+ /F1.0 10 Tf
77
+ [<41> 74 <7620646120536175646164652031313235>] TJ
78
+ ET
79
+
80
+ 295.087 549.071 122.740 22.677 re
81
+ S
82
+
83
+ BT
84
+ 297.0866141732284 565.6500314960631 Td
85
+ /F1.0 6 Tf
86
+ [<42> 35 <41495252> 40 <4f>] TJ
87
+ ET
88
+
89
+
90
+ BT
91
+ 297.0866141732284 551.918031496063 Td
92
+ /F1.0 10 Tf
93
+ [<46727574616c>] TJ
94
+ ET
95
+
96
+ 417.827 549.071 62.362 22.677 re
97
+ S
98
+
99
+ BT
100
+ 419.82677165354335 565.6500314960631 Td
101
+ /F1.0 6 Tf
102
+ [<434550>] TJ
103
+ ET
104
+
105
+
106
+ BT
107
+ 419.82677165354335 551.918031496063 Td
108
+ /F1.0 10 Tf
109
+ [<31332e3137312d333230>] TJ
110
+ ET
111
+
112
+ 21.260 526.394 187.370 22.677 re
113
+ S
114
+
115
+ BT
116
+ 23.25984251968504 542.9728661417323 Td
117
+ /F1.0 6 Tf
118
+ [<4d554e4943cd50494f>] TJ
119
+ ET
120
+
121
+
122
+ BT
123
+ 23.25984251968504 529.2408661417323 Td
124
+ /F1.0 10 Tf
125
+ [<53554d415245>] TJ
126
+ ET
127
+
128
+ 208.630 526.394 115.087 22.677 re
129
+ S
130
+
131
+ BT
132
+ 210.62992125984258 542.9728661417323 Td
133
+ /F1.0 6 Tf
134
+ [<464f4e452f46> 74 <4158>] TJ
135
+ ET
136
+
137
+
138
+ BT
139
+ 210.62992125984258 529.2408661417323 Td
140
+ /F1.0 10 Tf
141
+ [<2831392920323130342d36333030>] TJ
142
+ ET
143
+
144
+ 323.717 526.394 32.315 22.677 re
145
+ S
146
+
147
+ BT
148
+ 325.71653543307093 542.9728661417323 Td
149
+ /F1.0 6 Tf
150
+ [<5546>] TJ
151
+ ET
152
+
153
+
154
+ BT
155
+ 325.71653543307093 529.2408661417323 Td
156
+ /F1.0 10 Tf
157
+ [<5350>] TJ
158
+ ET
159
+
160
+ 356.031 526.394 124.157 22.677 re
161
+ S
162
+
163
+ BT
164
+ 358.0314960629922 542.9728661417323 Td
165
+ /F1.0 6 Tf
166
+ [<494e53435249c7c3> 55 <4f20455354> 93 <414455> 40 <414c>] TJ
167
+ ET
168
+
169
+
170
+ BT
171
+ 358.0314960629922 529.2408661417323 Td
172
+ /F1.0 10 Tf
173
+ [<3637312e3030382e3337352e313130>] TJ
174
+ ET
175
+
176
+ 493.228 571.748 82.772 22.677 re
177
+ S
178
+
179
+ BT
180
+ 495.228346456693 588.3271968503939 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
+ 528.44 574.5951968503938 Td
188
+ /F1.0 10 Tf
189
+ [<32392f31302f32303131>] TJ
190
+ ET
191
+
192
+ 493.228 549.071 82.772 22.677 re
193
+ S
194
+
195
+ BT
196
+ 495.228346456693 565.6500314960631 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
+ 528.44 551.918031496063 Td
204
+ /F1.0 10 Tf
205
+ [<33302f31302f32303131>] TJ
206
+ ET
207
+
208
+ 493.228 526.394 82.772 22.677 re
209
+ S
210
+
211
+ BT
212
+ 495.228346456693 542.9728661417323 Td
213
+ /F1.0 6 Tf
214
+ [<484f524120444520454e54524144> 40 <412f5341cd44> 40 <41>] TJ
215
+ ET
216
+
217
+
218
+ BT
219
+ 538.44 529.2408661417323 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
+ 0000003089 00000 n
262
+ 0000003281 00000 n
263
+ 0000003379 00000 n
264
+ trailer
265
+ << /Size 8
266
+ /Root 2 0 R
267
+ /Info 1 0 R
268
+ >>
269
+ startxref
270
+ 3478
271
+ %%EOF