Dear Terry,
After searching via Google, I found that:
1. "A UPC-E barcode has 6 digits with an implied number system 0."
[http://www.morovia.com/education/symbology/upc-e.asp]
2. "UPC-E is a variation of the UPC-A symbol that is used for number
system 0."
[http://www.makebarcode.com/specs/upc_e.html]
3. In Wikipedia, the coding table showed only the number system 0
only.
[http://en.wikipedia.org/wiki/Universal_Product_Code#Zero-
compressed_UPC-E]
The upce ENCODER supports non-zero number systems. However, I've
tried to generate some upce barcodes with non-zero number systems
and used barcode readers/scanners (both software and hardware-based)
to recognize them. And neither could decode those barcodes.
So, are non-zero number systems allowed in UPC-E?
(How do they convert to corresponding UPC-A?)
If only leading 0 is allowed, how about changing the upce ENCODER to
accept 6 (or 7) digits and with an implied leading 0?
====
--- a/barcode.ps 2009-11-05 16:05:05.541225700 +0800
+++ b/barcode.ps 2009-11-05 13:01:05.399428300 +0800
@@ -1131,7 +1131,7 @@
% --BEGIN ENCODER upce--
% --SUGGESTS ean5 ean2--
% --DESC: UPC-E
-% --EXAM: 0123456
+% --EXAM: 123456
% --EXOP: includetext height=0.4
% --RNDR: renlinear
/upce {
@@ -1193,22 +1193,22 @@
% Derive the equivalent UPC-A for its checksum
/upcacode (00000000000) 11 string copy def
- barcode 6 get 48 sub 2 le {
- upcacode 1 barcode 1 2 getinterval putinterval
- upcacode 3 barcode 6 1 getinterval putinterval
- upcacode 8 barcode 3 3 getinterval putinterval
+ barcode 5 get 48 sub 2 le {
+ upcacode 1 barcode 0 2 getinterval putinterval
+ upcacode 3 barcode 5 1 getinterval putinterval
+ upcacode 8 barcode 2 3 getinterval putinterval
} if
- barcode 6 get 48 sub 3 eq {
- upcacode 1 barcode 1 3 getinterval putinterval
- upcacode 9 barcode 4 2 getinterval putinterval
+ barcode 5 get 48 sub 3 eq {
+ upcacode 1 barcode 0 3 getinterval putinterval
+ upcacode 9 barcode 3 2 getinterval putinterval
} if
- barcode 6 get 48 sub 4 eq {
- upcacode 1 barcode 1 4 getinterval putinterval
- upcacode 10 barcode 5 1 getinterval putinterval
+ barcode 5 get 48 sub 4 eq {
+ upcacode 1 barcode 0 4 getinterval putinterval
+ upcacode 10 barcode 4 1 getinterval putinterval
} if
- barcode 6 get 48 sub 5 ge {
- upcacode 1 barcode 1 5 getinterval putinterval
- upcacode 10 barcode 6 1 getinterval putinterval
+ barcode 5 get 48 sub 5 ge {
+ upcacode 1 barcode 0 5 getinterval putinterval
+ upcacode 10 barcode 5 1 getinterval putinterval
} if
/checksum 0 def
0 1 10 {
@@ -1222,7 +1222,8 @@
} for
/checksum 10 checksum 10 mod sub 10 mod def
/pad 8 string def
- pad 0 barcode putinterval % Add barcode to the start of the
pad
+ pad 0 48 put % Put implied zero to the start
of the pad
+ pad 1 barcode putinterval % Add barcode next to the leading
zero
pad 7 checksum 48 add put % Put ascii for checksum at end
of pad
/barcode pad def
/txt 8 array def
@@ -1231,20 +1232,6 @@
% Determine the mirror map based on checksum
/mirrormap mirrormaps checksum get def
- % Invert the mirrormap if we are using a non-zero number system
- barcode 0 get 48 eq {
- /invt mirrormap length string def
- 0 1 mirrormap length 1 sub {
- /i exch def
- mirrormap i get 48 eq {
- invt i 49 put
- } {
- invt i 48 put
- } ifelse
- } for
- /mirrormap invt def
- } if
-
/sbs 33 string def
% Put the start character
@@ -1258,7 +1245,7 @@
length /indx exch def % indx is the length of pre
pop pop % Discard seek and post
/enc encs indx get def % Get the indxth encoding
- mirrormap i 1 sub get 49 eq { % Reverse enc if 1 in this
position in mirrormap
+ mirrormap i 1 sub get 48 eq { % Reverse enc if 0 in this
position in mirrormap
/enclen enc length def
/revenc enclen string def
0 1 enclen 1 sub {