APD, seeking example to print image

Within the APD documentation, I don't see if the APD supports image output.

Do you have any examples of APD sending images to a printer?

Anonymous (not verified)
I have done this in the past

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.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Todd Crook
Hi Dan,How would you transmit

Hi Dan,

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?

Regards,

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
apd.PSExternal(256,

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.

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Log in to post comments