jQuery Plugin To Generate International Article Number Barcode - EAN13

File Size: 18.2 KB
Views Total: 11077
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To Generate International Article Number Barcode - EAN13

EAN13 is a lightweight jQuery plugin used to generate EAN-13 (International Article Number) barcode using Html5 canvas element, with callbacks support and styling options.

See also:

How to use it:

1. Load the jQuery EAN13's javascript after jQuery javascript library.

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="dist/jquery-ean13.js"></script>

2. Create a canvas element to generate an EAN-13 barcode.

<canvas id="ean" width="400" height="200"></canvas>

3. Call the plugin with the International Article Number.

<script type="text/javascript">
$("#ean").EAN13("9002236311036");
</script>

4. Available options and API callbacks.

$("#ean").EAN13("9002236311036", {

// only printing the barcode use the code below.
number: false, 

// show country prefix.
prefix: true, 

//  the color of barcode.
color: "#000", 

// the background of barcode.
background: null,

// padding
padding: 0,

// debug mode
debug: false,

// callbacks
onValid: function() {},
onInvalid: function() {},
onSuccess: function() {},
onError: function() {}

});

Change logs:

v2.2.5 (2016-08-09)

v2.2.2 (2016-07-28)

  • JS update

v2.2.2 (2015-11-23)

  • Fix check digit generation it is zero

v2.2.1 (2015-11-18)

  • Add error description to onError

v2.2.0 (2015-07-30)

  • Update.

v1.4.1 (2014-08-11)

  • Update.

This awesome jQuery plugin is developed by joushx. For more Advanced Usages, please check the demo page or visit the official website.