Click here to Skip to main content
13,904,914 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 11 Feb 2013
Licenced CPOL

Programming Barcodes: Scanning the Nuances

, 11 Feb 2013
Rate this:
Please Sign up or sign in to vote.
Scanning the nuances in barcodes.
Over the past few decades barcodes have slowly become a part of everyday life. Every purchase from a supermarket, clothing outlet, or hardware store involves scanning a barcode. Over the last 10 years, interactions with barcode technology have vastly improved. The industry has expanded and innovated to a point where the start-up costs are no longer prohibitive. Unfortunately, companies are not utilizing them to their full potential. Give a developer $100 and ten minutes and a barcode scanning application can be born. The following sections provide a simple overview of interacting with barcodes and scanners.

Understanding Barcodes

There is no single standard format for barcodes. Currently, there are well over 50 different formats available. These formats can be grouped into two categories: Linear and 2D (a.k.a. matrix code). Linear barcodes are the classic thin and thick lined style that use a start and stop delimiter. 2D formats can vary in size and style although the size remains constant within a format. Below are examples of each:

2D / Matrix Code

The difference between the two is the amount of data contained within the barcode. Linear barcodes are 1-dimensional while 2D codes are 2-dimensional. Although many options exist, there are a few standard/popular styles such as: UPC, Code 39, and QR Code. Some barcode formats such as Code 39 are available as a font. This eliminates the need for programming to perform simple tasks. It also makes testing a breeze. When selecting a barcode format, please research all associated costs. Some are free while others require licensing or membership fees.

Working With Scanners

Barcode scanners range in price from under $100 to a few thousand dollars. The price depends on three attributes: form factor, technology, and barcodes supported. The most common form factors are hand-held, free standing, and mobile. Technology factors include bluetooth and the type of scanning technology used: imager, laser, CCD, or omni-directional. Every barcode scanner has a preset number of barcodes it supports. When selecting a barcode to use, it is important to consider the cost of scanners that support it. USB barcode scanners are an excellent choice for cross platform development. USB is a common standard found in all modern hardware. USB scanners also have the benefit of being automatically installed as a keyboard wedge. This means barcodes will be translated as keyboard data. No special programming required.

Most scanners come with a variety of customization options including special pre/post commands, custom interactions, and much more. For ease of use, it is advisable to stay away from customizing these devices. This can turn into an implementation nightmare and few devices have the same set of custom options available. By default, USB scanners append a keyboard command after every successful scan. This command is either a "tab" or "enter" key.

Building Software

In terms of development, with a basic knowledge of barcodes and scanners the sky is the limit. Utilizing fonts is an excellent option for an installed product, but what about the web? There are a variety of jQuery plug-ins to help with this need that take minutes to implement. They create barcodes for end-users that can be viewed and printed (if necessary). Many associate barcodes with product inventory management. Although this is an excellent use, barcodes can be unitized any time tracking is required. Postal carriers, Amazon, and sports arenas all use barcoding systems. Adding barcode capabilities is a fast and cheap way to broaden a product's offering.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web06 | 2.8.190306.1 | Last Updated 11 Feb 2013
Article Copyright 2013 by Zac Gery
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid