Posted on

Kindle Paperwhite 4th Gen

I've used a Kindle since the Kindle Keyboard (3rd gen), and since then purchased and used the DX for a while (the much larger model). On 06 September 2012 the Kindle Paperwhite was released and I registered mine on 10 September. I broke that model within six months by wedging it in a bag that had too many objects in it, but Amazon sent out a replacement free-of-charge (which included free shipping, and I live outside the United States).

Continue reading Kindle Paperwhite 4th Gen

Posted on

Amazon UCC128 Barcode

Updated 24-Nov-2018

Publishing Toolchain/Workflow Notes

Syntax for ISBN .eps

./bookland -o 978-0-9822972-7-8.eps 978-0-9822972-7-8

Syntax for Amazon ASIN (effectively a hyphen-less ISBN-10 of the ISBN-13)

encode128 0982297270

Take output and use Code128 Font to display

The Amazon Barcode

Note for revision: the latest version of encode128 is using different start/stop characters than what is displayed/discussed below. Need to correct this. The main point is to use encode128 encoder and the code128* fonts from the same developer, which work well together.

Anyone wishing to use Amazon Advantage (for media publishers) or Amazon Fulfillment, needs to include barcodes on individual items, so that they are stored and selected as individual units. Amazon provides the following information in one of their PDFs:

Amazon Barcode Guidelines

If you would like to print barcodes directly on Units, use the UCC128 barcode. The UCC128 barcode standards are available on the Internet.

6.2. Amazon uses the UCC128 barcode (font) to encode the FNSKU or the ASIN in the barcode. We don't use any leading or trailing digits (application identifiers or checksum digits).

6.3. The full specification is UCC128 code set A (this is the code set that supports alphanumeric data).

6.4. If you are building the barcode from scratch, you can review the standards or purchase software (there are many barcode applications available for free or at reasonable prices).

To someone who doesn't know jack about barcodes, this is bewildering and unhelpful. Sure there are many barcode applications available for free or at reasonable prices but where are they, how do they work, and more importantly, which ones do the Amazon thing of UCC128 (which is not actually a name or standard of anything).

And so the adventure begins.

Code 128 A B C

First off, the 128 of Code 128 has to do with ASCII (which is 128 characters), some extended characters (all of Latin-1), and some clever compression (if compressible). Also, the GS1-128 shipping standard (formerly known as EAN) is a subset of Code 128. This means that all shipping and most product identification labels rely on all or some part of how this code works.

Secondly, the A,B,C are slightly different schemes (different character set support) which most system support all of. That is, there is code switching between the different sets, depending on what is encoded. A is A-Z, 0-9; B is A-Z, a-z, 0-9, and some punctuation; C is 00-99. B is the most common scheme (that can be used by itself, but C allows for compression if there is a pattern to the characters (e.g., repeated characters, or characters in series). If nothing fancy is needed then B is fine.

In Code 128 bar code encoding, each character consists of alternating three bars and three spaces (with a possible thickness of 1-4), a start character, a stop character, and just before the stop character is a checksum character, based on a calculation.

Note that each character in a bar code fits into 12 widths (that is, the three spaces and three lines much together add up to 12 widths). In practice, Code 128 is 11 widths, and lines and spaces are 1-4 widths in width. Each character starts with a line, and ends with a space, excluding the final end character which is 13 widths and ends with a 2-width line.

Starting and Stopping Characters

For Code 128 B Character Set, the starting character is Ñ (a capital N with an enya (tilde) overhead).The stopping character is Ó (capital O with an acute). Sometimes these are indicated as a different character, but what is most important, is having a font system that matches the control characters to be used.

Note: don't use the Code128.TTF, instead use one of these better Code 128 Fonts

Calculating the Checksum Character

The basic calculation is a modulo (remainder, after dividing by 103 non-delimiter characters) of the sum of the text string numerical values multiplied by their position. For a text string HELLO, we would see:

  • Start B = 104
  • H = 40
  • e = 69
  • l = 76
  • l = 76
  • o = 79


modulo 103 ((104)+(401)+(692)+(763)+(764)+(795)) (Note the 104 for Start B, whereas if the barcode were only a number, it would Start C.) = modulo 103 (40+138+228+304+395) = modulo 103 (1105) = 10 remainder 76 76 is the lowercase letter *L (see Encoded: Hello is: ÑHellolÓ

Practical Note: use the command line code 128 encoder to generate the codes, and then use a Code128* font to render it, or use the bookland python script to generate an .eps file (which is better when needing an encoded ISBN barcde with all the trimmings). Bookland can't just do a barcode, but interprets even an ISBN-10 without hyphens into an ISBN-13.

Bugnote: The code-128 has a problem rendering the character for Capital-I-Diareses (which looks like a divide-by sign as well), so there has to be a fall-back to non-compressed encoding (start and end characters, plus checksum, but no clever encoding). The start and end characters from code-128 are Ò and Ó, and for non-compressed it is Ñ and Ó. A simple LibreOffice Calc implementation of code128 for non-compressed is available.

Amazon Barcode Generation

While in the very first bit of text that Amazon provides, it says it does not use leading or trailing digits or checksum digits. This is not correct (at least from Amazon generated Purchase Orders and Shipping Labels). Amazon uses a Code 128 B scheme (their start character is a B Start) but constrains the codes to A-Z, 0-9 (no lower-case alphabetic characters). They do use a checksum.

Does this really matter? Probably not. Most likely, all user/customer/vendor-generated codes (with or without start/stop/checksum) will be recognized. Implementation for bar code scanners is in software, and even most of the mobile apps that do bar code recognition support codes with and without start, stop and checksums. However, it does make sense to use the same system that Amazon implements. And of course to understand how this works in case of needing to generate missing Amazon barcodes such as Purchase Order or Shipment numbers. And so, now we know.

The simplest approach is two steps:

  • Take the given text string, use Code 128 B and calculate the checksum (as in the example above)
  • Append the start and stop control characters as well as the checksum character
  • Use Code128.TTF font, and then adjust for appropriate width and height (I use Inkscape for this)

Note that this does not use clever compression to produce fewer characters and therefore fewer bars on the barcode.

Note: Better Code 128 Fonts

Bar Code Typeface, Font, and Typography

Because characters always have the same numeric value, and the same bar code encoding, it would be simple to simply type in what will be represented (generally, capital letters and numbers only), and change the typeface, rendering the characters into bar codes. A great, open source, and free TTF font is available from

Online Encoding / Local Scripts

Note, most sites suck over time, and so even if we built a link to something that didn't suck, that would become untrue. Best to stick with code we can manage, that is forked github repositories, namely: bookland python script.

ISBN Tools for Amazon ASINs

Note that Amazon ASINs are not necessarily ISBNs but in many cases they are. When submitting an ISBN-13 as the product code, an ISBN-10 is generated (without hyphens) as the Amazon ASIN.

Note the Library of Congress ISBN Conversion Tool

Online Tools

The Barton site has a handy Barcode encoding tool that generates the start, stop, and checksum characters. This makes it easy to copy/paste into a Barcode Font text and voila, a fully generated (and editable) barcode. However, it uses an old system so the control characters do not match up with the standard found in the Code128.TTF v.2.0. Also, the Barton site has the OLD 1.2 version of the Code128.TTF font. Avoid both.

Encoding and Barcode Generation Implementations

Visual Basic / VBA

Better (though a bit old school) is using Libre Office and a macro as offered by the amazing Grand Zebu, who was also the original source of this open source font (have to enable Macros to run in security settings).

Note: this no longer runs on the latest version of Libre Office.


Somewhat bloated, half-refactored implementation in PHP (really, a great thing, but monolithic).

Javascript / Node Barcodes

The modern and well-supported tool is the JsBarcode project.

Posted on

The Problem with Apple Leadership

The basic problem with Apple Computer is one of leadership. In particular, it is not the financial engineering, or the desire to keep everything secret, or even the slow rate of innovation, including buggy Apple TV, Itunes, and the virtually unusable iCloud. It is not the poor performance of the new versions of iOS. The problem is one of focus, which results in many of these poor experiences, and even more importantly deprives the customers and potential customers of delight that the company could so easily provide. In the short term this doesn't matter much, but in the long term this is a company killer. I will list three examples that have easy, inexpensive fixes/enhancements, and would provide a multiple of delight, but these are largely overlooked by Apple that is led by Tim Cook.

Wither iPod Shuffle?

The iPod, that diminishing segment of Apple revenues. Just take a look specifically at the iPod Shuffle. Why has this not changed? The form factor and functionality has not budged since Steve Jobs was still alive. Nor has the price. Only the colors. How frivolous is that? Yes it is a declining product line because there has been no real innovation! - Quick fixes: Double the ram at the same price. Quadruple the ram at twice the price. Same ram at half the price.

What about the MacBook Air?

So we have a new version of the MacBook Air, and what did we get? 10% more battery life? Oh, and a discount - but only in some markets. This is the kind of frivolous thinking that shows how out of touch leadership is. As a MacBook air user, the biggest issue has to do with RAM. But RAM is cheap. Again, this is the iPod Shuffle problem. - Quick fixes: Double the minimum ram at the same price (8gb standard). Allow for an upgrade to 12gb or 16gb ram at an additional cost.

International Markets and Pricing

The issue of the MacBook Air is even worse when viewing this from the perspective of many International markets. There is in fact NO discount on the new version of the MacBook Air in the Thailand Apple stores and the Vietnam Apple stores. (I have not checked others, but this may be a trend internationally.) Apple strictly controls all pricing so we know exactly whom to blame. Apple. Why? What kind of good will is given up in markets where the prices for goods are higher than in the United States? We are not dealing with a greater cost issue. - Quick fixes: Set benchmark prices every month with International equivalents based on current exchange rates. This would send the message that International buyers are charged the same as US customers.

The Root of the Problem

We all know that Tim Cook is not Steve Jobs. This is not necessarily bad, but it is very bad when we look at the costs and quick fixes that are easy to make and would not have a negative impact on the bottom line. How hard is it to set pricing, or include extra ram? About the easiest things that could be done at Apple. How hard is it to focus on customer delight across the board, and not just customer delight that will bring in an extra billion? Not hard, but not important to Tim Cook. The problem is that Tim Cook does not see the connection between inexpensive, but not revenue producing customer delight and revenue producing customer delight. The delight with Apple is cummulative. People will put more of their wallet into Apple products if Apple were delighting customers across the board. When Apple cheapens our experience, then our experience of Apple cheapens, it declines. And the willingness to buy additional Apple products, much less customer loyalty in general, declines. This is the problem with Apple Computer under Tim Cook.