I have done this in the past using the "send format" functionality. This basically allows you to send raw binary data to the printer. The bitmap data is actually stored in a format file on the device file system, so this will work if you're always printing the same image. What you need to do is build a binary file that has the bitmap data and any commands that the printer needs to know what to do with it. What I do is start with a bitmap file, then use a hex editor to add in the native printer "print bitmap" commands at the beginning of the file. For instance for a Zebra TTP2030, I add hex 1B 62 00 00 64 00 00 just before the "BM" which is the start of the bitmap data. That is the binary data to tell the printer that there is bitmap data coming and telling it where to print it on the page. This would be different for a different printer using a different printer language. You might be thinking that it would be easier to send that binary command in a seperate file, but I have found that if you do that, there will be some other characters sent between that data and the bitmap, so it won't work correctly. If you put it all in one file, it works. I have 2 customers using this in production today using PocketBrowser on MK500 devices (printing their logo on on the top of the page). I use an older free version of the hex editor from hexedit.com. Not sure if there's still a free version or not, but any hex editor you can find should work.
How would you transmit the BMP to the printer?
The APD doesn't seem to offer a binary parameter to send to the printer.
Currently, I'm sending simple text output through a command such as this:
apd.PSExternal(266, strOut );
The APD Programmer's Manual doesn't seem to indicate a command for sending binary data, only TEXT() types.
The APD documentation has a PDF with notes about a printing Demo, however I don't see the demo code contained within the MSI file.
Is there additional APD documentation that would describe sending Binary images to the printer?
1 of 1 people found this helpful
apd.PSExternal(256, strFilename );
Where strFilename would contain the filename of the format file. 266 is the send string command, 256 is the send format command.