Hi everybody, here is my announced EAN128 support
I didn't have time to write a proper documentation, so
here is a crashcourse:
Advice: try this patch the demo applet!
Description of XML-Format:
If you want to encode multiple Application Identifiers
(AI) you usually have to show where one AI ends and the
next one starts. The char that separates the AIs can be
specified by <group-separator>
In this implementation you can ALWAYS use the
<group-separator> between two AIs, even if
EAN128-standard does not allow a FNC1 (so you do not
need to understand the EAN128 details).
The rules for usage of FNC1 are misunderstood very
often (I hope I got it right, discussion welcome):
If the AI starts with chars
"00" - "04", "1", "20", "23", "31" - "36" or "41"
you are not allowed to use an FNC1 in front of the next
AI. In every other case you MUST use one!
My intend was to use ASCII-Code "GS" aka
ASCII-Group-Separator aka x1D for <group-separator>.
Most EAN-128-capable barcode scanners deliver this sign
if they read an FNC1! So a lot of EAN128 users do not
know what FNC1 is. Unfortunately I could not use "GS"
in fop. Chars below 32 seem to cause trouble. So I
default to xF1.
If really love the feature <checksum>auto</checksum> in
barcode4j (eg in ean-13) so I want to keep it.
Unfortunately in EAN128 this is more difficult. Lets
have a look at AI (8003). It contains 13 digits (n13)
followed by the check digit (cd) followed by 1 to 16
So i introduced a special character
<check-digit-marker> that will always be replaced by a
check digit if it is found at a proper place.
(Fortunately in most cases you even can omit the
<check-digit-marker>: eg AIs (00), (01), (02),
(410)-(415) and if you want to (91) USPS Confirmation
In my first version all the EAN128 AIs had been
hardcoded. The code was small, readable and in the
spirit of object orientation. Then I needed new AIs.
Late I did some research and found some more. After
that I found even more and more and more... So I
decided to make everything configurable. I apologize
for the state of my code.
The idea is to define which AIs you want to use and how
they look like:
allowed data types are numeric (n), alpha-numeric (an),
date (d) followed by a fixed or variable length
A check-digit (cd) has always a length of one. (cd0
means check-digit calculation includes the AI!
Greetings from the USPS) AIs can consist of several
Parts indicated by '+'-Signs.
Most AIs I found are already defined in
You do not need an <template> for them.
Some are not include because they are country specific
(like (91)-USPS Confirmation Service) or mutually
agreed between trading partners (90).
<omit-brackets>true<omit-brackets> does not show the
Known Bugs: Very often the human readable text is much
bigger than the barcode. This is not honored in
computation of size so the human readable text gets
workaround: increase the quiet-zone. Be aware that you
have to undo this as soon the bug is fixed.
Don't be surprised if I need some days to answer your