C# create GS1-128 with Barcodelib

341 Views Asked by At

I use the NuGet package Barcodelib to create the barcode. I wanted to ask if any of you know how to create a GS1 code with this package. Here is an excerpt of the script where the field txtBarcode.Text is converted

            barCode.Alignment = BarcodeLib.AlignmentPositions.CENTER;

        BarcodeLib.TYPE type = BarcodeLib.TYPE.UNSPECIFIED;
        type = BarcodeLib.TYPE.CODE128;
        try
        {
            if (type != BarcodeLib.TYPE.UNSPECIFIED)
            {
                barCode.IncludeLabel = true;
                barCode.RotateFlipType = (RotateFlipType)Enum.Parse(typeof(RotateFlipType),"Rotate270FlipNone", true);
                Barcode.Image = barCode.Encode(type, txtBarcode.Text, Color.Black, Color.White, nW, nH);
            }

can you please give me an example for this? Thanks

1

There are 1 best solutions below

0
user3545432 On

I figured it out, just insert the "È" character

string BC = "È" + txtBarcode.Text;
Barcode.Image = barCode.Encode(type, BC, Color.Black, Color.White, nW, nH);

thank