1

I've been working with the netbarcodewriter library from https://github.com/simongh/barcodes and have been able to successfully generate code 128 barcodes. It fails when I try to encode (95)00209(96)0004471(97)0065(98)1931 with the EAN128 using the GS1Builder.

Below is an example in LinqPad:

GS1Builder gs1= new GS1Builder();
// add the AIs
gs1.Add(95,"00209");
gs1.Add(96,"0004471");
gs1.Add(97,"0065");
gs1.Add(98,"1931");
gs1.ToDisplayString().Dump();
var ean128 = new EAN128();
bmp = ean128.Generate(gs1, new BarcodeSettings { BarHeight = 65 });

I get a FormatException in EncodeCodeC when trying int.Parse(value) where value contains FNC1. I know this is likely my lack of understanding of EAN128, but I can't see what I'm missing.

EDIT I have also stripped the FNC1 character before parsing, but I end up with an invalid barcode image.

EDIT 2 When I simply concatenate the AIs and values ((95)00209(96)0004471(97)0065(98)1931 -> 9500209960004471970065981931), and encode that as CODE128 the scanners return the exact same value as a valid EAN128 with the same values. Does that mean that I can modify this to simply encode as Code128, but display friendly human readable text below the image? How can I generate EAN128 barcodes?

Has anyone been able to successfully generate EAN128 barcodes with this libarary?

Terry Burton
  • 2,801
  • 1
  • 29
  • 41
reckface
  • 5,678
  • 4
  • 36
  • 62
  • Did you read the EAN128 spec and make sure your encoded value conforms to the rules? http://www.barcodeisland.com/uccean128.phtml – Shane Wealti Jun 19 '14 at 13:24
  • Yes. And again after your comment, but comparing it with the specification from the customer doesn't leave much room for variation. They selected those Application Identifiers and specified the values/length of each AI to use. – reckface Jun 19 '14 at 16:17
  • We ended up buying the Softmatic barcode library full corporate licence, and we can now generate all these barcodes we need (and more). – reckface Jul 03 '14 at 16:42
  • 1
    You should report this issue on GitHub https://github.com/simongh/Barcodes/issues/new – Guillaume Apr 13 '15 at 12:51

0 Answers0