I am really confused about printing and reading barcodes. I want to generate Code 128
barecode using C#. Using Crystal Reports I found two ways to this:
However I am looking to do this in my own application, not Crystal Reports.
I want to know what the difference between them? Is there any problem by using the font one since it is more simple and do not any add file-ons to my project?
Finally anyone can give me a link to download barcode Code 128 font (FREE)
The thing about Code128 is that you can not just use a font and go for it (like it's the case for CODE39 for example). Why?
Result: You really need a piece of software to "encode" the barcode.
Example: The software needs to convert
Hello User
into
<STARTB>Hello User<CHECKSUM><STOPCODE>
Or the number
0815
would have to be turned into
<STARTC>(/<CHECKSUM><STOPCODE>
You can, of course, use a ready-made library. However: If you search for a description of Code 128 you will be very easily able to implement it yourself. Usually you'll end up with an image.
I found that this project has really helped me out with barcodes; http://www.codeproject.com/Articles/20823/Barcode-Image-Generation-Library .
It supports a decent amount of encodings and is fairly easy to use
string value = "12345678";
TYPE encoding = TYPE.CODE128;
var barcode = new Barcode(value, encoding);
barcode.IncludeLabel = true; //We want to display the value below the image.
Image image = barcode.Encode(encoding, value, 300, 100);
//Handle the image here...
Although it is not a font it does return an image like this
which could be printed or handled however you wish.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.