Code 128 Barcode Generator In JavaScript – code128.js

Category: Javascript | July 12, 2018
Author: kwoktung
Views Total: 4,412 views
Official Page: Go to website
Last Update: July 12, 2018
License: MIT

Preview:

Code 128 Barcode Generator In JavaScript – code128.js

Description:

code128.js is a small JavaScript library to generate Code 128 based alphanumeric or numeric-only barcodes using JavaScript and HTML5 canvas.

How to use it:

Install the code128.js with NPM.

# NPM
$ npm install code128.js --save

Import the code128.js library.

import code128 from 'code128.js'
<!-- OR -->
<script src="dist/index.js"></script>

Generate a new barcode from an input you provide.

var code = new Code128('cssscript')

Render the barcode in a specific container.

code.insert(document.body)

You Might Be Interested In:


One thought on “Code 128 Barcode Generator In JavaScript – code128.js

  1. George DASCALU

    If you want to make this code to be compatible with internet explorer (ie) you should change all the find methods with filter()[0]
    -example :
    —————————————————-
    ELEMENT_TABLE.find(function (o) {
    return o[1] === item;
    });
    to : ————————————————
    ELEMENT_TABLE.filter(function (o) {
    return o[1] === item;
    })[0];

    —————————————————–
    and you will can generate codebar on IE

    Reply

Leave a Reply