print image

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
anyone can help with sending an image to printer ?

i manage to print text to a BT printer using serial
can anyone help on how can i print an image (jpg) ?

thanks
 

timwil

Active Member
Licensed User
Longtime User
depends on the printer

there would be a code that you will tell the printer that the next x number of bytes is an image
 
Upvote 0

timwil

Active Member
Licensed User
Longtime User
depends on the printer

If it is an Epson or compatible printer it would use the ESC/POS control codes to download the image

What type (brand) of printer is it?
 
Upvote 0

timwil

Active Member
Licensed User
Longtime User
Do a google search on ESC/POS - IF that is the type of printer you have!!!

You need to check what type of printer you have - then look up the programmers manual - that would have the correct commands to send to the printer to print an image
 
Upvote 0

skywalker34

Member
Licensed User
Longtime User
Do a google search on ESC/POS - IF that is the type of printer you have!!!

You need to check what type of printer you have - then look up the programmers manual - that would have the correct commands to send to the printer to print an image

Thanks, I already do that before asking : my printer is axiohm 631 supposed to to ESC/POS compliant but their manual isn't exhaustive and clear at all as they offer driver for several OS (but not Android).
To change font size I finally found the detail on "confidential manual" issued from EPSON but I don't find the code to send image. I need to print the customer logo on the header and maybe some icon.

PS: I have used your bt printer code to start connection with the printer, thanks for sharring your knowledge about this
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Thanks, I already do that before asking : my printer is axiohm 631 supposed to to ESC/POS compliant but their manual isn't exhaustive and clear at all as they offer driver for several OS (but not Android).
To change font size I finally found the detail on "confidential manual" issued from EPSON but I don't find the code to send image. I need to print the customer logo on the header and maybe some icon.

PS: I have used your bt printer code to start connection with the printer, thanks for sharring your knowledge about this

hi,
sending a fixed logo should not be an issue as you can download it once into the printer and then just send the command to dump it.
all POS printers have this feature
so you "burn" the logo into the printer's eprom and then every time you need you send the esc sequesnce to print it - that is very simple and easy.

MY problem is sending every time DIFFERENT image to the printer so storing like i described is nor an option
 
Upvote 0

skywalker34

Member
Licensed User
Longtime User
hi,
sending a fixed logo should not be an issue as you can download it once into the printer and then just send the command to dump it.
all POS printers have this feature
so you "burn" the logo into the printer's eprom and then every time you need you send the esc sequesnce to print it - that is very simple and easy.

MY problem is sending every time DIFFERENT image to the printer so storing like i described is nor an option

Yes exactly the same for me !
 
Upvote 0

skywalker34

Member
Licensed User
Longtime User
Hi

Thanks for those links
My pb keep the same : I understand That I have to use ESC * command but the explanation keep quite obscure to me I take some sample on other technical data on print a small "saw" graphic line but I can send complete printer crash and power off as soon I send data....

A small sample code would be great to confirm my printer and then my coding.
 
Upvote 0

timwil

Active Member
Licensed User
Longtime User
I know what you mean about it being obscure.

I have not personally printed any images on these printers.

Did you try with a small, simple image? I suspect that your printer may not have that much memory and that if your image is too complicated it will crash the printer
 
Last edited:
Upvote 0

skywalker34

Member
Licensed User
Longtime User
I know what you mean about it being obscure.

I have not personally printed any images on these printers.

Did you try with a small, simple image? I suspect that your printer may not have that much memory and that if your image is too complicated it will crash the printer

Yes I was thinking so , I test with sending step by step and now this didn't crash the printer....a good step ! :sign0060::sign0060:

Now when sending chr(255) that is supposed to be a black dot, the printing is not good and totally black and give a very strange pattern. I have to solve this point now to go further :)
 
Upvote 0

skywalker34

Member
Licensed User
Longtime User
ok guy here is my analyse :

To send graphics to print we must use ESC/POS command
command is ESC (1B) hexa and (27) decimal
followed by * (2A) ie (42) decimal
then m parameter mode for density 0<=m<=1
then nL witch is in fact the number of pixel (width) of the image

then we send the code for a 'bar' of 8 pixel height (in mode 0 or 1)
a value of 0 give nothing, 1 give small dot at the bottom of the bar and 128 a small dot at the top......FF( 255) should print a full black bar

so to print you prior have to set the print with 1B 33 18
chr(27) & chr(51) & chr(24)
then set the bit image mode with 1B 2A m nL
chr(21) & chr(42) & chr(0 or 1) & chr(pixelWidth in decimal)
then send chr(barvalue) for (pixelWidth) time loop

then have to restart the next line :
set the bit image mode with 1B 2A m nL
chr(21) & chr(42) & chr(0 or 1) & chr(pixelWidth in decimal)
then send chr(barvalue) for (pixelWidth) time loop

and so on up to the end of the image

I quite sure of this but now the problem seem now to transfer to printer with bluetooth : too high speed it crash, too slow ( byte to byte) this print the text but not the bar...

No more paper on the roll today to continue my testing for today.... :eek:
 
Upvote 0
Top