Creating and Using Barcodes with Free Software

Barcodes provide a simple, reliable, machine-readable way to read numbers or addresses into your computer (or smartphone or tablet) so that information can be looked up online or in a database. There are a number of different standards for barcodes, and the most-commonly used ones are quite easy to use and create with simple free software applications, whether you want to incorporate them directly in your cover art, or make stick-on labels for marking packages. Here, I'll walk you throught the basics of three popular types of barcodes: UPC, EAN (including ISBN), and QR codes.

You might think that improvements in computer vision will make barcodes unnecessary -- won't computers eventually be able to read the same covers and title information that we do? Well, probably they will get better, but titles are ambiguous even for humans. Which particular part do you need to read? Is it the original or a remake? And so on.

So barcodes remain really useful to mark retail products and books for sale, to provide a small amount of textual information, or even to provide a URL to link to very detailed information about an object in the real world.

The simplest barcodes (and the ones that have been in use the longest) are the one-dimensional barcodes used in supermarket check-out lines. These simply encode numbers -- either the 12-digit "Universal Product Code" (UPC, still used to some degree in the USA) or the 13-digit "International Article Number" (originally "European Article Number" or EAN). These are designed to be read by simple helical scanners which have been in use for decades now. By using a valid code, a product can be recognized and looked up by scanners anywhere on Earth.

If you are keeping track of already-retailed products or books, you can simply use the existing numbers, but if you are creating a new product or book, you'll need to pay a fee to the appropriate registry to get a new code for your product. For a retail product, you would start by acquiring a prefix for issuing "Global Trade Item Numbers", which you can purchase from the company that runs the registry, GS1 (http://www.gs1.org or http://www.gs1us.org in the USA). A good starting point for that is the page "Get Started with U.P.C. Barcodes" ( http://www.gs1us.org/get-started/im-new-to-gs1-us in the USA, or http://www.gs1.org/barcodes/need_a_bar_code globally -- this will redirect you to the barcode provider for your country).

For books, you'll need to get an "International Standard Book Number"), which is organized separately from other retail products. With the wave of self-publishing and print-on-demand introducing a lot more self-publishers and small publishers to the market, this has been made much easier. A lot of print-on-demand companies offer a service to acquire ISBNs for you. However, you can also go directly to the source. Each country has a different ISBN provider, which you can locate through the international ISBN page at https://www.isbn-international.org. For the USA, this is R.K. Bowker.

How a 10-digit ISBN is converted to an EAN-13 barcode.

Today, ISBNs are integrated into the EAN / GTIN system, by assigning all books to a fictitious country, "Bookland". The old 10-digit ISBNs can be converted to 13-digit EAN numbers (needed for a barcode), by adding the Bookland prefix "978" at the beginning, followed by the first 9 digits of the ISBN, and then a final checksum digit (this typically won't be the same as in the original 10-digit ISBN, because the checksum algorithm for EAN is different -- but don't worry, barcode generator programs will compute this for you).

Making Your Barcode in Inkscape

Producing the barcode itself is trivial in Inkscape -- the leading Free/Open Source Software vector drawing application -- ever since the extension became part of the standard distribution, with version 0.46. The current version supports several kinds of barcodes, including the UPC and EAN types.

Simply open Inkscape on a document in which you want to include a barcode (perhaps it's part of a cover design, or you might have loaded a label template, such as the ones provided by World Label). Find and select the "Extensions" drop-down menu, select "Render" and "Barcode..."

This will take you to a dialog where you can select the desired barcode type. For UPC, pick "UPC-A" (or for tiny packages if you have the right type of number for it, you can select "UPC-E"). And for EAN (or ISBN converted to EAN), select the "EAN-13" option.

The process for creating an EAN-13 barcode label in Inkscape.

Now you just type in the number (either from a product you are referencing or a new number using a registry prefix acquired from one of the previously-mentioned sources). For UPC, you need to type 11 digits. For EAN, you need to type 12. The 12th or 13th digit (respectively) will be calculated for you (you can enter it, but if it's wrong, you'll see an error message -- better to leave it out and then compare the result with the original number to make sure you didn't make a mistake typing the number).

Click "Apply", and the barcode will be drawn into your Inkscape document. That's all there is to it!

Creating a QR Code Graphic with QtQR and Inkscape

Of course, UPCs, ISBNs, and EANs are all based on monopolistic central registries and big proprietary data silos. Not exactly the "freedom-loving" solution for sharing information. And you might balk at the costs involved if you want to get your own codes.

But wouldn't it be nice if there were a global registry that was distributed? And even nicer if you already had a code for it? Fortunately, there is a registry -- it's the World Wide Web's URL system, and there is a very convenient barcode for sharing URLs, which is the "Quick Response Code" (QR Code), originally developed for the Japanese automotive industry, but which became an online consumer fad for a few years.

And because it was a fad, lots of people installed applications on their smartphones to read the codes using the phones' cameras, and even send a browser to the linked webpage automatically. That's a pretty convenient system if you want to share some detailed online information with your customers.

A QR code provides a way to put a URL hyperlink on a real object, and this has a lot of practical applications, ranging from advertising promos to linking to warranties or manuals. For the author's Lunatics project, we've used them to provide handouts with links to an audiodrama and to create labels for "Creator Endorsed" products to link to the transparency information we've promised to share with our customers.

As of 0.48, Inkscape does not come with an extension to create QR codes, and the only one available does so using a website service call, which is hardly free software. But there is a python-qrencode library and there are graphical front-end programs which make generating QR code images very easy: QtQR and Qreator.

Creating a QR code with QtQR, checking it with a web browser, and using it in an Inkscape drawing.

I use QtQR for this. To generate a QR link image, simply open QtQR, select "URL" from the drop down menu, and then type or paste the URL you want the link to connect to. The QR image will appear as you type this. Save this image to disk. Then I suggest that you immediately use the "Decode" option to load the same image and automatically load the URL in your browser. This will serve to test that the link is the one you intended.

Finally, just import this PNG image of the QR code into your drawing.

Now you know how to create three of the most popular barcode types. With this ability, you could mark storage shelves with the products you need to restock them. You could print additional labels if you neeed them as a retailer. Or you could use the codes to communicate about your own products, whether it's just lookng up a price or finding your online store through a QR code link.

By Terry Hancock