Generating UPC Check Digits in Bulk

Morovia offers a check digit calculator online at http://www.morovia.com/education/utility/upc-ean.asp. With this utility, you can calculate check digit by entering your numbers - no matter it is a UPC, EAN, SSCC, GTIN or BLN.  It is a wonderful utility and has been running for many years since Morovia started.

Now, Morovia added another online utility to allow you to calculate check digits in bulk. This is quite useful when you have a range of number. The typical case is the UPC-A numbers you own. For example, you could have a GS1 prefix 123456789, which leaves you 2 digits for your item number. And you want a list of final numbers with check digits.  Repeating 100 times is tedious work on a web page. Now no more.

Go to http://www.morovia.com/bulk-check-digit-calculation/index.php and enter 123456789??. Note that the two question marks repsent any digits in the last two positions.  Click on Submit and the web page send out the answer -

123456789005
123456789012
123456789029
123456789036
123456789043
123456789050
123456789067
123456789074
123456789081
123456789098
123456789104
123456789111
123456789128
123456789135
123456789142
123456789159
123456789166
123456789173
123456789180
123456789197
123456789203
123456789210
123456789227
123456789234
123456789241
123456789258
123456789265
123456789272
123456789289
123456789296
123456789302
123456789319
123456789326
123456789333
123456789340
123456789357
123456789364
123456789371
123456789388
123456789395
123456789401
123456789418
123456789425
123456789432
123456789449
123456789456
123456789463
123456789470
123456789487
123456789494
123456789500
123456789517
123456789524
123456789531
123456789548
123456789555
123456789562
123456789579
123456789586
123456789593
123456789609
123456789616
123456789623
123456789630
123456789647
123456789654
123456789661
123456789678
123456789685
123456789692
123456789708
123456789715
123456789722
123456789739
123456789746
123456789753
123456789760
123456789777
123456789784
123456789791
123456789807
123456789814
123456789821
123456789838
123456789845
123456789852
123456789869
123456789876
123456789883
123456789890
123456789906
123456789913
123456789920
123456789937
123456789944
123456789951
123456789968
123456789975
123456789982
123456789999

All 100 numbers are listed in order. Quite neat.

Create QRCode Symbols Free Online

Morovia has just published a new free utility - online QR Code Maker. This is a not a demo version as it does not add watermark or other text. We intended to make it free online permanently. Visit it today.

I made  a QR symbol with 238 characters encoded. Want to know what is inside? Print the page and Scan it to find out -:)

example QR code image

background image

Recently a customer asked us a question -

I have an emergency task. I have a spreadsheet with all product codes (tens of thousands of them). I need to print barcodes for them. I do not have an advanced IT system for this task. I want to print them one by one in Avery label papers. Do you have software doing that?

Small companies often have needs to print barcodes.  But not many of them have dedicated IT systems for the purpose, or in-house programmers that can come up with a solution at any time. Some examples -

  • You want to add a barcode into the invoices, so that you can find the invoice quickly. Your current software that prints invoices, Quickbooks, does not have the capability.
  • You run a retail store and occasionally you bought some items with no UPC barcode on the box. You want to print UPC barcodes and stick them on the boxes by youself.
  • You want to stick barcodes with special serial number encoded. In this way, you can check if the item returned by your customer was indeed sold from your store.

The first option is to use barcode fonts. A typical solution is to add a column in the spreadsheet that holds the barcode strings, and use Word Mail Merge to get the barcodes into the label paper (which is a Word document0. It does not require advanced programming knowledge. Unfortunately, many companies do not use VBA at all nowadays, and it seems to become a formidable task for many people.

Fortunately, Monterey Barcode Creator has a “batch printing” feature.  You do not need any programming knowledge at all to print barcodes into label papers with this program.

Let’s assume that you have a speadsheet that lists all yor product codes in one column. You want to print sticks with barcodes on it, and each stick corresponds to one product code.  You will then print them to Avery Label Paper 3111 on a laser printer. After stickers are printed, you stick them one by one on the item box.

CSV File

First of all, Monterey Barcode Creator can’t read Excel file directly. You will have to export to a .csv file.  CSV is the abbreviation of Comma Separated Value, a format used to exchange data between software.  Each line is a record, and column values are separate by commas.  The below line is an example:

1003434323214, 0-20-ABC-2004, Product Item One

You can generate a .csv file by choosing “Save As” and specify .csv as the format.

As you can see from the example record, a line contain multiple columns. Columns are numbered from 1. Record your column number, you will need it soon.

You can also use Copy/Paste to paste the whole column to Notepad, and save it into a text file. This file can be thought as a special type of .CSV, as each record has only one column.

Adjusting Barcode Properties

Now start Monterey Barcode Creator.  The images created by Barcode Creator can contain three parts - barcode, human readable text and a text comment. We do not need comment here so we uncheck “comment” box. Change the barcode type to “Code128″. You might want to change other properties, such as BarHeight and NarrowBarWidth.  There are quite a number of properties that you can change. If you are interested, read the product manaul at http://mdn.morovia.com/manuals/mbc3/shared.properties_methods.php.

Remember that all barcodes will have the same property set (except the barcode and human readable text).

After you are satisfied with the barcode size, you can now print them out. From File Menu, choose Print.

Batch Printing in Barcode Creator

Print Dialog in Monterey Barcode Creator 3

Print Dialog in Monterey Barcode Creator 3

First, make sure that “Use Label Settings” is checked. If it is not checked, you will not see the bottom portion of the dialog. Use “Label Products” and “Product Number” to select the label paper you print on.  The program has most paper listed, but if you can not find the one you have, you can enter it into the database by selecting “New Label…”.  After you are done with the label paper selection, Click on Print Batch.

print-batch-datafile-setup

Batch Setup (Data File Mode)

Monterey Barcode Creator supports two batch modes - Number Sequence and Data File. Number Sequence mode allows you to specify a sequence. For our work, we will use Data File mode. Click on the Data File to switch, and right side of the dialog will change accordingly. You will supply two parameters:

  1. File Path. This is the path of your CSV or Text file. You can use the small “” button to navigate to the file, or type it by yourself.
  2. Column. The cardinal of the column that the data is from.  If  you pasted the data to a text file, you only have one column and it cardinal is 1.

Click OK to dismiss the setup dialog, and click OK on the Print Dialog to print out. If you have hundreds of thounds of records to print, it may take quite some time.

The data file we used for this article can be downloaded here. And the print result is here.

Creating Barcode Strings Using PHP

If you are creating barcode using barcode fonts, you should already know that you can not just type your number and format with a font. Extra characters such as start/stop characters, and often times checksum characters are required to be present in the barcode.  Some formats such as Code 39 and Code25, are easy. But formats like Code 128 are quite difficult. To easy the difficulty creating barcode strings, Morovia provides source code, Windows DLLs and COM classes that you can integrate in your applications.

For an overview on these utilities, visit http://www.morovia.com/font/support/font-tool.asp.

Many people asked the question - do you have an example with PHP? It turns out that it is not difficult to do it in PHP at all. The following code creates a Code128 barcode string (which becomes a Code128 barcode after being formatted with Morovia Code128 font):

<?php
$encoder = new COM("cruflMorovia.Barcode");

$result = $encoder->Code128Ex(”PN-NUMBER-13334432″);

echo $result;
?>

Note that the Prog ID of the encoder COM object is cruflMorovia.Barcode. You can write code for other barcode types. For example, for EAN-128 barcodes, just replace Code128Ex with EAN128Ex.

GS1 has published a new coupon format to be used in North America, called DataBar Coupon. This coupon code can encode. The Application Identifier (AI) for this code is 8110, and the value can be from 25 to 39 digits long.

You can use Morovia DataBar Fontware to create such a coupon. You can create the code in drawing programs such as Adobe Illustrator, or Word Processing programs such as Microsoft Word. Adobe Illustrator users might want to read this article for a tip on adjusting line heights.

  1. The coupon code requires the company prefix and offer code to be printed on top of the barcode. Started with a text box and enter this information on the top.
    word-textbox
  2. Open Morovia DataBar Font Encoder GUI.
  3. Choose DataBar Expanded Stacked in the Barcode Type box, and enter the coupon code in the Data to Be Encoded box. Note that you must include both AI and data, and AI must be enclosed with parentheses. Make sure that the Symbols Per Row is set to 6.

    DataBar Encoder GUI

    DataBar Encoder GUI

  4. Press Make Barcode button and the barcode will appear below.
  5. Press Copy to Clipboard to transfer the barcode into clipboard.
  6. In Microsoft Word, press Paste to Paste the barcode into the text box. Right click on the barcode and choose Ignore Once to disable spell checking.
    word-databar-coupon-barcode
  7. Now you created the coupon code. According to GS1, before January 2010 you should also include the UPC-A coupon symbol. After that date the UPC-A coupon is no longer necessary.

In Morovia DataBar Fontware’s manual, it explains how to overcome the line gap issues in several programs, such as Microsoft Visio. It did not mention Adobe Illustrator, which alos has the same issue.

Adobe Illustrator does not present a menu item for you to adjust line height.  That is at least what I found on my computer (Illustrator CS2). Instead, you have to press Ctrl+T to pop up the character palette, and make the line height the same as the font size you selected.

illustrator-databar-problem

In the character palette, make sure that the line height is the same as the point size. The gap then disappears.

illustrator-databar-good

Conclusion - in Adobe illustrator you can adjust the line height. To do so, press CTRL+T to pop up character palette and change the line height to be the same as the font size.

Free Online Barcode Generator

You can now create barcode easily from your browser. Morovia has just announced the availability of Online Barcode Generator.

Again the address is http://www.morovia.com/free-online-barcode-generator/.

The new coupon code (AI 8110) is required to be printed in GS1 DataBar Expanded Stacked. Its data can be quite long. In fact the length is the longest we have ever seen in GS1-128 - from 25 to 39 digits. GS1 DataBar Expanded Stacked can have multiple rows, depending on the data and the value of SegmentPerRow. The value of SegmentsPerRow can be anywhere between 2 and 22. 22 also produces one-row barcode.

In some cases, it is desirable to find out the range of SegmentPerRow, based on the data encoded and the number of rows desired. For example, our coupon codes can be between 25 to 39 digits, but we want all barcodes created two rows.

To find out the relationship among the data length, segment per row and the number of rows in the barcode created, we wrote a simple perl program. It calls the encoder DLL included in Morovia DataBar Fontware to get the barcode string, then parses the string to find out how many rows in the result. It generates randomized data as input (based on DataBar Spec, it is not necessary as numeric data with the same length should always create the same length barcodes, all things being equal). It increases the number of digits one by one, and calculates using all possible SegmentsperRow values. Warning: if you are running the trial version, do not run this program - you will have to press OK button hundreds of times to complete the program (each call pops up a ‘trial notice’ message box).

We found that the results can be divided into five groups - 25 digits, 26-32, 33-39, 40-46 and 47-49. It seems that each segment encodes 6 digits. Note - the digits we talked here refer to the coupon code, not including the AI portion.

coupon code length vs. row

For small manufacturers with dedicated IT stuff, it is often a pain to write a trivial program. Numbers such as UPC-A, EAN-13, SCC-14, SSCC-18 and Bill of Lading (BLN) all require a modulo 10 check digit at the end. Although the algorithm is simple, it is easy to make mistaken if done by human. Fortunately you can now calculate check digits online using this free web utility. All you need is an Internet connection.

UPC Coupon Value Codes

The value codes are the two digits before the last check digit. They have fixed meanings as defined by GS1 organization. The table below lists the meanings effective as of writing.  Occasionally GS1 changed the meanings of some. Fortunately, The changes were rare and the last update happened in year 200.

coupon-values-upc