Print barcode on Intermec PB20 via LinePrinter API

Does anyone know how to print a barcode on an Intermec PB20 bluetooth printer from a Windows Compact Framework application? We are currently using the Intermec LinePrinter API, but could not find a way to print the barcode.

+4
source share
5 answers

Thank you all for your thoughts. Printing directly to the serial port is the most flexible method. In this case, we did not want to replicate all the work that was already built into the Intermec dll to handle the port, printer errors, etc. We were able to get this work by sending the printer the appropriate codes to switch it to another mode, and then transmit direct printer commands.

Here is our solution in case anyone else encounters a similar problem working with Intermec Printers. The following code is a test case that does not catch errors and repeating printer errors, etc. (See Intermec Code Examples.)

Intermec.Print.LinePrinter lp; int escapeCharacter = int.Parse("1b", NumberStyles.HexNumber); char[] toEzPrintMode = new char[] { Convert.ToChar(num2), 'E', 'Z' }; lp = new Intermec.Print.LinePrinter("Printer_Config.XML", "PrinterPB20_40COL"); lp.Open(); lp.Write(charArray2); //switch to ez print mode string testBarcode = "{PRINT:@75,10:PD417,YDIM 6,XDIM 2,COLUMNS 2, SECURITY 3|ABCDEFGHIJKL|}"; lp.Write(testBarcode); lp.Write("{LP}"); //switch from ez print mode back to line printer mode lp.NewLine(); lp.Write("Test"); //verify line printer mode is working 

There is a white paper on the Intermec support site titled "Technical Manual" that describes code for direct printer management. The Easy Print section describes how to print various barcodes.

+1
source

The last time I had to print a barcode (despite the printer or framework), I resorted to using the True Type font with the barcode I needed. (In my case there was EAN-13), a European barcode.

There are fonts in which you simply write numbers (and / or letters with their support), and you get the perfect barcode that any scanner can read :)

Google is your friend. I do not know if there are any.

0
source

Thanks for your reply. Free fonts available. However, the PB20 is a pocket printer with several built-in fonts. It has the ability to print barcodes and can be controlled directly through the serial port. Intermec provides the .Net CF API to make printing β€œsimple,” and it uses this API that we were unable to figure out how to tell the printer to print the barcode.

0
source

Disable all APIs and use the serial port API directly.

Speak the language of printers and you can get decent results. Every other approach is frustrating. Not so pretty, but that's how my old factory works. 4 thousand printed tasks per day, and no one ever missed.

0
source

Free 3 of 9

This is 3 out of 9 (sometimes called "code 39"), a widely used barcode standard that includes uppercase letters, numbers, and multiple characters. This is not a barcode for the UPC (universal price codes) found on the store. However, most types of barcode scanners recognize 3 out of 9 well.

0
source

Source: https://habr.com/ru/post/1276428/


All Articles