开发者

Print barcode which has high scan rate

开发者 https://www.devze.com 2022-12-20 23:06 出处:网络
I did like to print a barcode using C#. I want the barcode to have a given height and width. I did download a free 3 of 9 barcode font and used

I did like to print a barcode using C#. I want the barcode to have a given height and width. I did download a free 3 of 9 barcode font and used

 Font barcodeFont = new Font("Free 3 of 9", 17, FontStyle.Regular);
 e.Graphics.DrawString("*"+label.Lpn+"*", barcodeFont, Brushes.Black,new RectangleF(166,235,115.16f,61)); 

to print it. I have two issues with this.

  1. ) for some font size barcode is printed in two line.
  2. ) even if I reduce the font and make it print in one line. The barcode does not scan well. I have to swipe it in a perticular way to make it work.

Is there a better 开发者_如何学编程way to print barcode which will scan every time??


There are minimum and maximum widths for the lines and spaces of a 3of9 barcode.

Take a look at this website for more info about these measurements: http://www.adams1.com/39code.html


Take a look here at CodeProject for a decent Barcode generator. This is capable of generating different types of Barcodes including 3 of 9.

Hope this helps, Best regards, Tom.


Code 3 of 9 does tend to be quite a wide barcode and the only way you'll really solve your problem is by giving it more space on the page.

An alternative to this would be to either encode your data so it takes up less characters/bars or instead do a database lookup, so 1 = Bananas, 2 = Apples, 3=VeryLongWordThatDoesntFit etc.

Another alternative would be to improve the quality of the barcode scanner. It is true with barcode scanners that the more you spend the better results you get.


Does the barcode font provide recommended point sizes? A free font might not have the hinting required to insure that each bar is an integral number of pixels wide. This might be a problem especially if your printer has an odd DPI. I'm aware of one model of label printer that is 203 DPI, good luck matching your font size to pixels on that printer!

0

精彩评论

暂无评论...
验证码 换一张
取 消