how to send bmp image to mobile printer esc/pos

1,162 views
Skip to first unread message

med-elhadi bounas

unread,
Sep 7, 2017, 4:40:02 PM9/7/17
to MIT App Inventor Forum
hello, is it possible to send an image bmp to mobile printer esc/pos and how can i use the esc/pos in app inventor ?

Abraham Getzler

unread,
Sep 8, 2017, 10:41:29 AM9/8/17
to MIT App Inventor Forum
Do you have a link to the technical manual for the printer?
ABG

med-elhadi bounas

unread,
Sep 8, 2017, 1:54:41 PM9/8/17
to MIT App Inventor Forum

Abraham Getzler

unread,
Sep 8, 2017, 3:32:31 PM9/8/17
to MIT App Inventor Forum
The manual you supplied was just a user manual, not a technical manual with data stream information.

However, from reading page 45, the graphic file format used is pcx, an old format.

The users manual mentions some Honeywell PrintSet software that you might be able to use to load
logos and other pre-cooked graphics to the device.

The user manual mentions that it uses ESC/P by default, and a web search gets

which includes sections on sending bit map graphics at


Does your phone have BlueTooth capability?
If so, there is a SendBytes block that can send a list of bytes,
which you would have to set up in your app.

See the BlueTooth sections of this FAQ for samples:

Also search the AI2 Gallery for "printer" in case you get lucky.
There must be plenty printer control apps in the Google Play Store.

ABG

med-elhadi bounas

unread,
Sep 11, 2017, 10:04:08 AM9/11/17
to MIT App Inventor Forum

hello, i tried to set bitmap image mode and then choose the image (loaded in my printer) to print but still not working



Abraham Getzler

unread,
Sep 11, 2017, 1:31:45 PM9/11/17
to MIT App Inventor Forum
Let's try to walk before you run.

ESC/P includes some easy messages you can use to test your
connection to the printer:

advance the paper forward
advance the paper backwards
send back status information.

I suggest trying those, to see if you are  really
talking to the printer.

ABG


Abraham Getzler

unread,
Sep 11, 2017, 2:09:19 PM9/11/17
to MIT App Inventor Forum
Also, you sent the list (27,42) to the printer.

That's ESC *  in ASCII, but I don't see it in the 

Where did you get that code?

ABG

med-elhadi bounas

unread,
Sep 12, 2017, 3:46:52 AM9/12/17
to MIT App Inventor Forum
yes i'am talking to the printer, i sent a line feed on bytes and the printer executed. 

about the esc * , it s for entering to bitmap graphics and i get it from the esc commands, i also tried the Define downloaded bit image, but i think i'm not doing it right.


Abraham Getzler

unread,
Sep 12, 2017, 1:12:12 PM9/12/17
to MIT App Inventor Forum
I will have to take it on faith that you have the manual for your model (?) of printer.
Having it respond to a Line Feed does nothing to confirm that you have the right model number,
only that you can send SOMETHING through, not how it should respond.

I see in your blocks diagram that you used the File component.
Those only work with text, and will probably fail on bit mapped images,
 since hex 00 is commonly used as
an end of file marker when reading text files, but would probably appear
several times in a bit mapped image file.

If you have an image file you want to print, maybe
you could use it as a background on a small Canvas,
then loop through every pixel of the Canvas, split its color,
and decide based on its 4 color components whether it
should be black or white, then assemble  byte streams
from that, line by line.

Show us your blocks if you need help with that,
along with proof that you have the right manual for your printer.

ABg



Reply all
Reply to author
Forward
0 new messages