holger-will / code-128-encoder Goto Github PK
View Code? Open in Web Editor NEWLicense: ISC License
License: ISC License
Very nice app! It works really well when I reference the file as instructed.
I thought it would be nice to use it as a module but ran into issues when doing so. I think it's because ES6 javascript modules enforce strict mode.
When imported with import './code-128-encoder.min.js';
I get this error code-128-encoder.min.js:3 Uncaught TypeError: Cannot use 'in' operator to search for 'String' in undefined at Object.$jscomp.polyfill
.
I want to encode GS1-128, which requires 'FUNC 1' as the 1st code.
I see that you use 50px in your examples. Is that the minimum size we should use?
I'm trying to use this library in React Native but when I import code-128-encoder and use "new Code128Generator()" I have the error TypeError: undefined is not an object (evaluating 'root.Code128Generator')
Left side space must be removed because FUNC1 should be able to be placed middle of code.
Hi,
I found your Code 128 font and encoder.
I generated a barcode with Code C for a code composed only of numerical values, but it did not work properly.
The cause is ascii [0] when multiple ascii are allocated in Code 128 Generator.codes
It is necessary to encode with ascii [1] with error.
In your library, you can change the getASCIIFromCode () method with options.mapping, but this does not work properly. If only one ascii is allocated, undefined is returned. You understand?
getASCIIFromCodeC () is fixedly called in optimize (), and ascii [0] is permanently specified in it. This does not call ascii [1], is it?
Therefore, the font you defined is useful, but the library of this project could not be used.
Hi,
Great project.
Would it be good to consider adding support for Libre Barcode 128(Google font) and similar fonts?
Somehow the encoded output from code-128-encoder
does not work, which can you check here.
Is it about standard/conventions? Is it possible to make it work with other barcode fonts?
Thanks
Encoding 1hnL9wrba2JYA3xxYGGcGq
results in Ì1hnL9wrba2JYA3xxYGGcGq Î
, when it ought to be Ì1hnL9wrba2JYA3xxYGGcGqÂÎ
.
Repro:
describe('Code128Encoder', () => {
const code128Encoder = new Code128Encoder()
it('encodes a problematic ID', () => {
const encoded = code128Encoder.encode('1hnL9wrba2JYA3xxYGGcGq', { output: 'ascii' as any })
expect(encoded).toBe('Ì1hnL9wrba2JYA3xxYGGcGqÂÎ')
})
})
I didn't find a change log and also noticed their weren't tags/releases for later versions that are published to NPM.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.