63

Is there a decent free API/component for printing barcodes in C#?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Vaccano
  • 78,325
  • 149
  • 468
  • 850
  • 1
    See similar question that may help: http://stackoverflow.com/questions/1998209/how-to-generate-barcode-from-a-string-using-c – Scott W Jan 11 '10 at 18:45
  • now, you can use ZXing library, it is on apache 2 license. https://github.com/micjahn/ZXing.Net/blob/master/COPYING free to use in commercial app – toha May 20 '23 at 05:05

3 Answers3

59

Could the Barcode Rendering Framework at Codeplex GitHub be of help?

Mika Sundland
  • 18,120
  • 16
  • 38
  • 50
Svish
  • 152,914
  • 173
  • 462
  • 620
  • 4
    Hint - You need to download the source file in order to find some sample projects that show some examples. There doesn't appear to be anything on the website. – John M Oct 20 '11 at 19:03
  • 9
    Quick an easy "Hello World" c# sample: Add Reference -> Browse -> Zen.Barcode.Core.dll. Then add in your code using Zen.Barcode **Code39 Examples:** `Code39BarcodeDraw barcode39 = BarcodeDrawFactory.Code39WithoutChecksum;` `pictureBox1.Image = barcode39.Draw("Hello World", 40);` PitureBox1 will now display the barcode type 39. It's readable by a scanner. – Patratacus Aug 16 '13 at 16:54
  • How to use this for a web application.? – Ankur Aug 23 '13 at 09:16
  • 4
    Does it work with .net core? – daneejela Feb 27 '17 at 21:41
52

I do recommend BarcodeLibrary (already removed from codeproject), but https://github.com/barnhill/barcodelib looks like its copy on github.

Here is a small piece of code of how to use it.

        BarcodeLib.Barcode barcode = new BarcodeLib.Barcode()
        {
            IncludeLabel = true,
            Alignment = AlignmentPositions.CENTER,
            Width = 300,
            Height = 100,
            RotateFlipType = RotateFlipType.RotateNoneFlipNone,
            BackColor = Color.White,
            ForeColor = Color.Black,
        };

        Image img = barcode.Encode(TYPE.CODE128B, "123456789");
Andrei Schneider
  • 3,618
  • 1
  • 33
  • 41
13

There is a "3 of 9" control on CodeProject: Barcode .NET Control

Rubens Farias
  • 57,174
  • 8
  • 131
  • 162