2

What I want is to generate a GS1 datamatrix using the bwip-js API with a FNC1 passed in.

I have tried the example provided in their website (Online Barcode API documentation) throught Postman and it returns the correct value back (ie. without the FNC1 character in the scanned result).

Their example request (parses FNC1 correctly)

http://bwipjs-api.metafloor.com/?bcid=code128&text=%5EFNC1011234567890&parsefnc&alttext=%2801%291234567890

However when I use my example for the GS1 data matrix, with the FNC1 value, I get the FNC1 in the scanned result. So it is not parsing the FNC1 value correctly.

My request (does not parse FNC1 correctly):

http://bwipjs-api.metafloor.com/?bcid=gs1datamatrix&text=%5EFNC1(01)03453120000011(17)120508(10)ABCD1234(410)9501101020917&parsefnc&alttext=%2801%291234567890

I have read all the documentation and articles I can find about their generator and the FNC1 character, but didn't give me any clues.

Am I doing anything wrong here?

UPDATE:

The input to BWIP-JS:

(01)99312650999998(91)111JD507496002000960300(420)2164(8008)181102113732

Image generated:

enter image description here

Terry Burton
  • 2,801
  • 1
  • 29
  • 41
Kavo
  • 543
  • 1
  • 6
  • 16

2 Answers2

2

The code in bwip-js is PostScript and I'm no expert in that language. But try taking the 'FNC1' out of your request and see if that works.

I think it's trying to automatically add FNC1 to any GS1 Datamatrix (see section starting a line 23903) when it sees an AI, whereas for Data Matrix it has to be explicitly requested.

Terry Burton
  • 2,801
  • 1
  • 29
  • 41
charlesbridge
  • 1,172
  • 10
  • 21
  • Looks like it. I have done this change and awaiting approval from the client. Will update as soon as I get a response. – Kavo Oct 25 '18 at 00:21
  • @charlesbridge @Terry Burton The client barcode reader didn't pick up any FNC1 characters unfortunately. I left out FNC1 from the request and removed the 'parsefnc' before sending it. I tried sending the request with and without the brackets in the application identifier as well. But to no avail. Any idea why? They use `Webscan Trucheck` as the barcode verifier. If that makes any difference I don't know. – Kavo Nov 01 '18 at 23:32
  • If you could please update the original question with the input to BWIP-JS that you are now trying and the image that it is generating then I'll investigate on the basis of what is provided. – Terry Burton Nov 02 '18 at 00:06
  • (Preserving the original question when updating, of course!) – Terry Burton Nov 02 '18 at 00:06
  • 1
    @Kavo You are generating an image using the datamatrix encoder, not gs1datamatrix as you provided in your initial description. – Terry Burton Nov 02 '18 at 11:50
  • This is indeed the case @TerryBurton! Thank you very much. – Kavo Nov 02 '18 at 12:17
0

The FNC1 character is invisible to the console, so it can be tricky to see, but I've managed to parse it out of raw strings using the following:

var decoded = decodedString.split(decodeURI("%1D"));

If you're getting the FNC codes in parentheses, you could probably use a REGEX to remove them.

Brian Berneker
  • 571
  • 6
  • 6