Generate Barcodes With The Zebra-Barcode_Upca Font And The Printdocument Object Follow
I have a client using an old VB6 program and Seagull’s Zebra print drivers to generate UPC barcodes with the ‘Zebra-Barcode_UPCA’ font. The client is currently running Bartender 7.2.
For example (VB6):
Private Sub print_Click()
Dim upc As String = "012345678905"
Printer.FontName = "Zebra-BarCode_UPCA"
Printer.FontSize = 24
Printer.CurrentX = 20
Printer.CurrentY = 20
The client wants the program updated to the .NET Framework using C# and Bartender 9.2. However, the font does not generate a barcode using the PrintDocument object. It just prints plain text.
For example (C#):
private void print_Click(object sender, EventArgs e)
PrintDocument printDocument = new PrintDocument();
printDocument.PrintPage += new PrintPageEventHandler(this.PrintPageEventHandler);
private void PrintPageEventHandler(object sender, PrintPageEventArgs ev)
String upc = "012345678905";
Font font = new Font("Zebra-BarCode_UPCA", 24);
float currentX = 20.0F;
float currentY = 20.0F;
ev.Graphics.DrawString(upc, font, Brushes.Black, currentX, currentY, new StringFormat());
The client has Bartender Label formats in place for other labels, but in this particular case the output needs to be created at run time. This application generates a label that contains 1 to 13 barcoded items depending on the contents of the box.
Is it possible to generate barcodes with the Zebra barcode fonts and the PrintDocument object? It not, is there another way to create barcoded output at run time?
Please sign in to leave a comment.