Font Based Barcode Generator – Barcode Font

Category: Javascript | April 29, 2016
Author:jangel058
Views Total:8,924 views
Official Page:Go to website
Last Update:April 29, 2016
License:MIT

Preview:

Font Based Barcode Generator – Barcode Font

Description:

Barcode Font is a pure JavaScript library which uses Fonts to generate Code 128 and Code 39 barcodes from any text.

How to use it:

Load the barcode-font.min.css and barcode-font.min.js into your html file. Don’t forget to upload the font folder into your web server.

<link rel="stylesheet" href="barcode-font.min.css">
<script src="barcode-font.min.js"></script>

The JavaScript to render a Code 128 barcode.

var barcode128 = barcodeFont('code128', 'TEXT YOU WANT TO ENCODE')
    .create({
      tagName: 'div',
      id: 'code128',
      className: 'codes test'
});

The JavaScript to render a Code 39 barcode.

var barcode39 = barcodeFont('code39', 'TEXT TO ENCODE', true)
    .create({
      tagName: 'span',
      id: 'code39',
      className: 'codes test'
});

You Might Be Interested In:


2 thoughts on “Font Based Barcode Generator – Barcode Font

  1. Byte Herder

    This works with some barcode text but not other text. For example, I can put the word ‘ENCODE’ in and it works great. My barcode reader gets the text. But if I put some combinations of numbers and letters, such as this Membership ID, it messes up:

    112453B4355

    Reply

Leave a Reply