huysentruitw / barcoder

Lightweight Barcode Encoding Library for .NET Framework, .NET Standard and .NET Core.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code128 cannot read by scanner

Int32Overflow opened this issue · comments

Hey,
the Code128Encoder is not working :-(

            var code128 = Code128Encoder.Encode("123", false);
            var renderer = new ImageRenderer();
            using (var stream = new FileStream("output.png", FileMode.Create))
                renderer.Render(code128, stream);
            Process.Start("output.png");

I tried to read the code, but this code seems to be not valid!

Probably because your reader expects a checksum. Try Code128Encoder.Encode("123", true) instead.

Thank you very much for the message. Right, that was the problem. Now the code can be read.

Welcome. Don't forget to ⭐️ this project if you like it 😎 Thanks!