-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use EAN13 format #2
Comments
After reviewing the source, I found out that the problem is caused by the drawer now supporting the output format of the EAN13 encoder. Array [
Object {
"data": "101",
"options": Object {
"height": NaN,
},
},
Object {
"data": "011101100101110110111011001101100010010111",
"options": Object {
"fontSize": undefined,
},
"text": "798159",
},
Object {
"data": "01010",
"options": Object {
"height": NaN,
},
},
Object {
"data": "100010011001101001110100111010001001100110",
"options": Object {
"fontSize": undefined,
},
"text": "715571",
},
Object {
"data": "101",
"options": Object {
"height": NaN,
},
},
] The |
I managed to solve it temporarily by changing line 161 of return encoded; to return encoded.reduce((p, n) => ({ data: `${p.data}${n.data || ''}`, text: `${p.text}${n.text || ''}` }), { data: '', text: ''}); thus flattening the array data. I didn't want to use a custom solution on a production project so I ended using this up-to-date fork of In case the mantainer of this package sees this, I would love to render my barcode as specified in this issue. I am willing to provide any of the help needed :) |
I updated with
To handle others formats than EAN13 |
When I select CODE128 everything works perfectly, but when I choose EAN13 with the following code I get an error:
The source line references changes every time, but the
undefined is not an object (evaluating 'binary.length')
remains the same, so it should be where the error is at.Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: