Coder Social home page Coder Social logo

code-128 about barcodelib HOT 5 CLOSED

barnhill avatar barnhill commented on July 20, 2024
code-128

from barcodelib.

Comments (5)

barnhill avatar barnhill commented on July 20, 2024

from barcodelib.

vidoa avatar vidoa commented on July 20, 2024

That explains the difference.
Is there a way to force the library to encode using code128 and not switching to 128-C regardless the data?
Thank you.

from barcodelib.

barnhill avatar barnhill commented on July 20, 2024

from barcodelib.

vidoa avatar vidoa commented on July 20, 2024

After some digging I found out why the barcodes are different.
Because my numbers have odd number of digits (19) if I use dynamic code 128 and don't specify the sub-type (A, B or C) your library is using code128C for the first 18 digits (9 groups x 2 digits) and code128A for the last 19th single digit. All others code128 generators are using code128B for the last 19th single digit. Technically, both barcodes are valid and scanners can read them. I guess there isn't a way to force the library to use 128B for the last digit without changing the source code.

from barcodelib.

vidoa avatar vidoa commented on July 20, 2024

I switched the two IFs that are choosing the encoding (128A or128B) for the last single digit in Code128.cs at lines 194 and 209 and now it works as I want. Now 128B has higher priority than 128A. For me 128B looks more common in cases like this.

from barcodelib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.