04-26-2006 10:39 PM
Does anyone know how I can trick the WRITE command to send binary data to a printer using the WRITE command.
I am writing a driver for an Eltron thermal label printer that supports the EPL2 command language. To send a small graphic (a logo) I use the "GW" command that requires binary data. Other printers (e.g. Zebra with ZPL2 language) accept Hex written as characters, but this one does not.
I've tried putting the necessary bytes into a hex (TYPE X) field but looking at the print spool I see that WRITE has helpfully converted the bytes to their 2 character hexadecimal equivalents. I want to send the bytes instead.
The output device is defined as ASCIIPRI.
Does anyone have any ideas?
04-27-2006 4:52 AM
HI
GOOD
TO THROUGH THE FOLLOING LINKS
http://www.makebarcode.com/info/appnote/app_024.html
THANKS
MRUTYUN
04-27-2006 12:26 AM
I think the hex/binary issue is a red herring. The data is represented as hex so that human beings can read it quickly - internally the data always occupies the bytes in binary code. Maybe the printer expects the data to be of a specific length and you are not complying. HAve you tried an XSTRING variable or RAW if it's from a dictionary based structure?
04-27-2006 4:52 AM
HI
GOOD
TO THROUGH THE FOLLOING LINKS
http://www.makebarcode.com/info/appnote/app_024.html
THANKS
MRUTYUN
04-27-2006 6:03 PM
Yes, exactly. The PRINT-CONTROL command in ABAP was what I was looking for. The image is now recognizable in printed output.
For future reference of anyone reading this, make sure you define your print control as "Hexadecimal" or it won't work. You will probably have to split the data up across several print controls, also, as the text field is only 58 characters long.
Thank you for your help guys!
Juan Suros
Kyocera International, Inc.