Home > database >  How Can I create a Code128 Auto barcode?
How Can I create a Code128 Auto barcode?

Time:12-16

So, I want to display a string as Barcode. I want to use Code128 Auto. And I dont want to use nuggets. How Can I do that? At the end I just want to have an TextBlock in WPF with the String of BarCode in it.

EDIT

So I already have an Font of Code128 in my Textblock in WPF. But my Problem is, that I cant scann the barcode font with an Barcode scanner.

CodePudding user response:

For generating a barcode you could use a library like NetBarcode. It will create an image that you need to display in your app. Displaying the barcode in a Textbox might not be possible since bitmap data is generated for code128 barcodes.

CodePudding user response:

Find a barcode font as suggested and do:

ont 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);

I can't think any other way beside using nuggets.

EDIT: Since people are doing useless punctualization, of course you need to use a barcode 128 font instead of a 3 of 9. Here's one: https://fonts.google.com/specimen/Libre Barcode 128

If you totally don't want dependencies, just go to github and implement the code of a library, so you don't have to go through nuggets.

I used successfully this one: https://github.com/Tagliatti/NetBarcode

  • Related