Write EAN128 barcode

Discussions about 1D barcode reading and writing
Post Reply
elisacosta
Posts: 9
Joined: Fri May 19, 2017 3:08 pm

Write EAN128 barcode

Post by elisacosta » Mon Jan 07, 2019 5:39 pm

Hi all,
I'm using GdPicture.NET 12.
I'd like to generate a barcode in EAN128 standard.
I suppose that this standard is not directly supported for writing, but I wonder if there is some work around to build the correct string (with the right start character , the FNC1 character ) and, starting from this string, to use Barcode1DWrite to generate the EAN128 barcode.

I've tried to generate barcode using Code128 but I obtained the sequence
'StartA-GS-CODEC-my value encoded with code 128C- mod 103- stop character'

I'd like to have a seuqence like:
StartC-FNC1-my value encoded with code 128C- mod 103- stop character

I've tried to add the FNC1 character (ASCII 29) at the beginning of the string, and to set code128 as barcode type parameter for Barcode1DWrite, but in this way I obtained the same barcode as without FNC1:
'StartA-GS-CODEC-my value encoded with code 128C- mod 103- stop character'

How could I generate a barcode recognizable as GS1-128?
Thank you very much

Best regards

Elisa Costa

Costinel
Posts: 33
Joined: Mon Jul 11, 2016 9:35 am

Re: Write EAN128 barcode

Post by Costinel » Thu Jan 10, 2019 8:31 am

Hi Elisa,

In order to encode FNC1 in the first position you should use something like:
string encode = Convert.ToChar(200).ToString() + "234879572875";

Code128C is available as a member of Barcode1DWriterType, but it is used only for numeric characters. If the data to encode is not numeric, the Barcode1DWrite method will return a BarcodeNotNumeric status.

Best regards,
Costinel Mitrea

elisacosta
Posts: 9
Joined: Fri May 19, 2017 3:08 pm

Re: Write EAN128 barcode

Post by elisacosta » Thu Jan 10, 2019 11:57 am

Hi Costinel,
Thank you very much for your quick answer.
I've tried to use the ASCII character 200 to add FNC1 at the beginning of barcode, and I actually obtained a barcode recognizable as GS1-128:

StartA - FNC1 - CODEC - myvalue - mod 103 - stop character

From your answer I understood that it isn't possble to obtain the format
StartC - FNC1 - my value -mod 103 - stop character
because Barcode1DWrite does not allow to manage a value containing FNC1 character directly with Code C? is it right?

Thank you
Best regards

Elisa Costa

Costinel
Posts: 33
Joined: Mon Jul 11, 2016 9:35 am

Re: Write EAN128 barcode

Post by Costinel » Thu Jan 10, 2019 12:11 pm

Yes Elisa, FNC1 in the first position is possible only with Code A or Code B.
Code C is used to encode only numeric data, at double density (2 digits are encoded as a single character).
But, if you use generic Barcode1DWriterType.Code128 and only numeric data after FNC1, it should encode it like:
StartA + FNC1 + SwitchToModeC + HighDensityNumericData + Stop, the result being a shorter barcode than if you use Code128A.

elisacosta
Posts: 9
Joined: Fri May 19, 2017 3:08 pm

Re: Write EAN128 barcode

Post by elisacosta » Thu Jan 10, 2019 3:49 pm

Thank you Costinel,
you were very clear and your help has been invaluable.

Best regards

Elisa Costa

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest