Looking for a small 1d barcode generator #1456
Replies: 9 comments
-
Posted at 2020-11-18 by @gfwilliams I don't know anything offhand, but there seem to be a bunch of different barcode styles. If you stuck with just one type I think it would be pretty easy to do from scratch. For instance EAN-13 doesn't look too painful: But I guess you might want UPC? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-11-18 by @MaBecker Thanks, was not searching on Wiki. Most companies use Code 128, wiki pointed to this nice barcode-svg repo which looks promising. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-11-18 by @gfwilliams Looks very promising! If you get it working nicely it might be nice to bring it into Espruino as a module? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-02 by @MaBecker Ok, got some time to work on this again and got some question: Q: How to pass a buffer and use the Graphics inside a module? Q: Lookup tables for char to barcode fillRect are very large, what is memory wise the best way to store them. Note: Got a EAN13 running and on the way for a module
compared to the original source Lookup table for CODE128 is much bigger.Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-02 by Robin Sun 2021.05.02 Hi @MaBecker several years ago, I had similar questions and several chimed in to solve with snippets and links regarding 'Flat Strings'. Here was Gordon's well described response:
Some sample snippets: > 'Q: How to pass a buffer and use the Graphics inside a module?' Is the question on how to process the image creation within the developer designed module, and access that ('pass a buffer') content inside the module, back at the console side of the WebIDE? Use the array buffer to access the flat string, similar when using a pointer in 'C' perhaps? Nicely done, if I might add! . . . |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-02 by @MaBecker
something similar to this http://forum.espruino.com/comments/15515743/ |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-04 by @gfwilliams Hi! I'm not sure I really understand the question? You can just use Graphics normally or pass the variable
Like in the code you posted? Uint8Array or String is best. Doing |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-04 by @MaBecker
So using
like this?
compare usage
So using |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-05-04 by @gfwilliams
I'd say passing it in as an argument is more flexible...
Then you have the option of drawing offscreen if you need.
I'd suggest: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2020-11-17 by @MaBecker
Sure there are many code generators easily to find in the internet, but none of them is small enough to fit for Espruino.
Is anyone working with tiny javascript 1D barcode generators and like to share it?
Beta Was this translation helpful? Give feedback.
All reactions