Search code examples
c#windowszebra-printers

C# - Printed serial numbers using Zebra printer is not scanning


I have a windows application that print serial numbers in 3 of 9 bar code font. It is then scanned by RF scanners. The issue is I am not able to scan certain serial numbers like if the serial has number 8, it is not scanning. Any advise would be appreciated!

Font barFont = new Font("3 of 9 Barcode", 10);
Graphics g = ev.Graphics;
g.PageUnit = GraphicsUnit.Millimeter;
SolidBrush br = new SolidBrush(Color.Black);

RectangleF rect = new RectangleF(new PointF(15, 2), new SizeF(45, 4));
RectangleF rect1 = new RectangleF(new PointF(15, 5), new SizeF(45, 3));
RectangleF rect2 = new RectangleF(new PointF(15, 7), new SizeF(45, 4));

StringFormat sf = new StringFormat();
sf.LineAlignment = StringAlignment.Center;
sf.Alignment = StringAlignment.Center;

g.DrawString("*" + printSerial + "*", barFont, br, rect, sf);

Solution

  • The issue was with the bar code font installed in my system fonts. Once I refreshed with the latest version, the bar codes are scanning.