Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Font to create barcode - is this correct? Am I missing something?

I saw a lot of threads and postings about .NET and generating barcodes. A lot of people are talking about libraries, dlls and some "out of the box applications". I just ask myself: do I really need this whole stuff? Im (at this time) able to create a barcode without any extra library or something else. Thats fine working with Font. I just need a barcodefont, lets take one free like 3 of 9, I can install it (actually I dont even have to install it, its enough to have the path to the file) and then Ill do something like this:

    Font f = new Font("Free 3 of 9", 80);
    this.Font = f;

    Label l = new Label();
    l.Text = "*STACKOVERFLOW*";
    l.Size = new System.Drawing.Size(800, 600);
    this.Controls.Add(l);

    this.Size = new Size(800, 600);

And I can display the barcode. And you know what? My phone is able to read it. So thats how easy it is. I could save it as jpg, I could past it into an xml file and so on. If I want another barcode, I just need the new font, change 3 of 9 to something else and thats it.

So here my question: what im I missing? Everybody is talking about "uh use something thats already done", "use libraries" and so on. So what problems could I get if I continue this without extra libs and other stuff? Any suggestions? Thank you

like image 514
sabisabi Avatar asked May 30 '12 13:05

sabisabi


1 Answers

3 of 9 is just one way to encode barcodes. Usually when we think of barcodes we are thinking of the UPC standards, but for most barcode readers, 3 of 9 works just fine. If it works for your application, don't waste your time with a third party library and just use the 3 of 9 font.

One thing to consider is that the 3 of 9 standard does not contain a check digit. This helps to detect read errors in some standards. The wikipedia page on the encoding has some details on this, but it sounds like it's not really a big deal because of the way the characters are encoded.

like image 98
Eric Andres Avatar answered Sep 23 '22 03:09

Eric Andres