Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
Hello Mentors,

g.DrawString(codes1, new Font("Free 3 of 9",30), Brushes.Black, new RectangleF(0, 13, 500, 50), strFormat);

In the above mentioned line size 30 which is the size of barcode i'm using does not read by the scanner when i give 35 and above size the scanner can read within a secs, rest of my code are working properly. Is there anything missing in this line.

Thanks in Advance
Posted

Many years of experience dealing with barcodes showed me that fonts are not a reliable solution. Instead, go for a graphic barcode algorithm that natively renders them on your dev platform i.e. in your case .NET

I suggest you to rid of your barcode-font-based code and move to a graphic approach. Here is some resources:

Barcode Image Generation Library[^] (free)
http://barcoderender.codeplex.com/[^] (free)
How to print images, pictures, texts and high quality barcodes using VB.NET or C#[^] (commercial)
http://www.idautomation.com/barcode-components/windows-forms-control/user-manual.html[^] (commercial)
 
Share this answer
 
Comments
Espen Harlinn 6-Nov-13 15:32pm    
Certainly 5'ed! :-)
While Marc has a good point, you should also consider getting yourself a professional bar code printer like one from Zebra[^]

These printers have their own API for printing bar codes that ensures crisp and clear output.

Best regards
Espen Harlinn
 
Share this answer
 
Comments
Marc Gabrie 6-Nov-13 12:53pm    
Totally agree with you Espen but problem is that maybe he needs to target common printers like laser or inkjet and that's (maybe) why he's using System.Drawing.Graphics class
Regards,
Espen Harlinn 6-Nov-13 15:31pm    
Which is why I mentioned that you have a good point :-)
Now, with regular laser or inkjet priners you sometimes run into problems with anti-aliasing, and every once in a while you print out a barcode that can't be read back by the scanner. A professional barcode printer reduces that problem significantly, and for many applications an unreadable barcode every once in a while isn't that much of a problem - but when it is, you need to use a real barcode printer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900