Coder Social home page Coder Social logo

jsbarcode's Introduction

Introduction

JsBarcode is a simple way to create different types of 1d barcodes.
The plugin uses Html5Canvas to generate draw the barcodes

This is the list of supported barcodes:

  • CODE128 (B)
  • EAN (13)
  • UPC-A
  • CODE39
  • ITF14

Use

####A Html5Canvas barcode generator is included to draw the barcodes.

$(object).JsBarcode(string,options);

####Where:

  • string is the sring to be encoded to the barcode
  • options is additional options put i an object (look below)

####The default options:

{
	width:	2,
	height:	100,
	quite: 10,
	format:	"CODE128"
}

Examples

####First we need an image

<img id="barcode">

This code:

$("#barcode").JsBarcode("Hi!");

Will generate this image:

Result

This code:

$("#barcode").JsBarcode("Javascript is fun!",{width:1,height:25});

Will generate this image:

Result

This code:

$("#barcode").JsBarcode("9780199532179",{format:"EAN"});

Will generate this image:

Result

This code:

setInterval(function(){
	var date = new Date();
	$("#barcode").JsBarcode(date.getHours()+":"+date.getMinutes()+":"+date.getSeconds());
},1000);

Will create a barcode clock:

Click here to see it

Minify the latest code

Use the closure compiler with this input

// ==ClosureCompiler==
// @output_file_name JsBarcode.all.min.js
// @code_url https://raw.github.com/lindell/JsBarcode/master/CODE128.js
// @code_url https://raw.github.com/lindell/JsBarcode/master/EAN_UPC.js
// @code_url https://raw.github.com/lindell/JsBarcode/master/JsBarcode.js
// ==/ClosureCompiler==

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.