jZebra & Epson TM-U220: Problems with bit image commands (ESC *)

1,348 views
Skip to first unread message

adrian hurtado

unread,
Oct 5, 2012, 9:30:28 AM10/5/12
to jzebra...@googlegroups.com
Hi,

I'm a newbe with jzebra. Now I can print a receipt using the sample.html with the modifications shown in http://code.google.com/p/jzebra/wiki/ESCPCommands. But now I would like to print a logo using the bit image commands (ESC *). I'm trying to get work the example shown at ESC-POS-Programming-Guide.pdf that is the following:


Here is my code for m=0 and only 1 cycle instead of 5:

function print() {
  var applet = document.jzebra;
  if (applet != null) {
    applet.append("\x1B\x40"); // 1
    applet.append("Test begins\r\n");

    // ESC * command
    applet.append("\x1B\x2A\x00\x10\x00\x01\x02\x04\x08\x10\x20\x40\x80\x80\x40\x20\x10\x08\x04\x02\x01");  // only 1 cycle instead of 5, as the example

    applet.append("Test ends\r\n");
    applet.append("\x1D\x56\x41"); // 4
    applet.append("\x1B\x40"); // 5

    // Send characters/raw commands to printer
    applet.print();
  }

  // *Note:  monitorPrinting() still works but is too complicated and
  // outdated.  Instead create a JavaScript  function called 
  // "jzebraDonePrinting()" and handle your next steps there.
  monitorPrinting();
}

In the resulting receipt, the texts "Test begins" and "Test ends" are printed perfect, but no other character or pixel is shown in the middle. The bit map is simply ignored.

Has anyone got print ESC * bit image commands?

Thanks and regards,
Adrián


adrian hurtado

unread,
Oct 5, 2012, 9:40:23 AM10/5/12
to jzebra...@googlegroups.com
Sorry, I missed the image showing the example. Here you are:

Thanks

Tres Finocchiaro

unread,
Oct 5, 2012, 10:52:58 AM10/5/12
to jzebra...@googlegroups.com
Adrian,

Unfortunately all web browsers have problems with \x00 (null).  This is because the javaScript language terminates strings this way.

There is an appendImage example in the wiki that does the hex conversion for you.  Can you try this out?  Just give the URL of the image and the ESCP option.

-Tres
--
To unsubscribe from this group, send email to jzebra-users...@googlegroups.com
 
http://code.google.com/p/jzebra

adrian hurtado

unread,
Oct 5, 2012, 12:55:01 PM10/5/12
to jzebra...@googlegroups.com
Hi Tres,

Thank you for the answer. I have tried replace the line for ESC * commands for this one:
    applet.appendImage(getPath() + "img/image_sample_bw.png", "ESCP");

But then I get something like that:
    Test begins
    Test ends



    @EG 16 64 0 0 000000000000000 …. about 20 cm of lines of hexadecimal characters … 0000000

So I can't print any image.

adrian hurtado

unread,
Oct 7, 2012, 12:10:25 PM10/7/12
to jzebra...@googlegroups.com
Hi again Tres,

I've just resolved the problem encoding the ESC * commands in base64 as I have seen in other post.

Thanks

Tres Finocchiaro

unread,
Oct 7, 2012, 12:34:03 PM10/7/12
to jzebra...@googlegroups.com
Thanks for the update. :)

-Tres

jan...@gmail.com

unread,
Oct 10, 2013, 9:06:45 AM10/10/13
to jzebra...@googlegroups.com
Hi. I'm using TM-U295 and not working printing images, neither example of jZebra 1.5.6.

Can you put the code that worked for you?

Thanks.

Tres Finocchiaro

unread,
Oct 10, 2013, 9:13:37 AM10/10/13
to jZebra users
Please try version 1.6.5 and see if that corrects your problem.

A sample has been provided with 1.6.5, just click the print escp image button.

-Tres

--
--
To unsubscribe from this group, send email to jzebra-users...@googlegroups.com
 
http://code.google.com/p/jzebra
 
---
You received this message because you are subscribed to the Google Groups "jZebra users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jzebra-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

jan...@hotmail.com

unread,
Oct 11, 2013, 5:32:55 AM10/11/13
to jzebra...@googlegroups.com
I've downloaded it and does not work.
Perhaps the hexadecimal codes must be different to print image.
I attach the pages of the manual.

Thanks.
TM_U295_ImageMode1.JPG
TM_U295_ImageMode2.JPG

Tres Finocchiaro

unread,
Oct 11, 2013, 8:27:13 AM10/11/13
to jZebra users
Yes, there is no doubt that that syntax is different.

Can you try this:

qz.appendImage(getPath() + "img/image_sample_bw.png", "ESCP", 0);

This will replace the 33 with a 0 and should work for your printer.

And also for clarification in language syntax, can you link me the manual you are using?  If I can differentiate between this automatically using code, it would be nice.

For example, do you think that one version is ESCP2 and the other is ESCP?  If so, I could simply allow ""ESCP2" to switch this code-side so that the "single" and "double" still work.

-Tres

jan...@hotmail.com

unread,
Oct 17, 2013, 5:07:01 AM10/17/13
to jzebra...@googlegroups.com
Thanks for your interest but neither works.
I attached the manual I'm using.

Thanks for all your time and effort.
TM-U295 Operator’s Manual.pdf

Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 15, 2014, 3:58:13 PM10/15/14
to jzebra...@googlegroups.com
hi, some body have a example how to send image to tm-u220 ?

thanks for time and help

i try the using the method from sample.html but is not working

Tres Finocchiaro

unread,
Oct 15, 2014, 4:10:19 PM10/15/14
to jZebra users

hi, some body have a example how to send image to tm-u220 ?

Have you tried using a smaller image?  Some printers can't handle the width of our logo and you should try cutting the image in half and seeing if that prints?

-Tres 

Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 15, 2014, 4:44:30 PM10/15/14
to jzebra...@googlegroups.com
hi, tres thanks for time and help. i am testing the TM-U220 using the sample.html
when i hit print the printer prints strange characters

Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 15, 2014, 5:15:39 PM10/15/14
to jzebra...@googlegroups.com
Test one
qz.appendImage(getPath() + "resources/images/logos/cpago/1.bmp","ESC *",0);
result : windows-1252 image conversion is not yet supported

Test two
qz.appendImage(getPath() + "resources/images/logos/cpago1.bmp","ESCP", "single");
result: prints strange characters

image: 
dimension 250x50
Bit Depth 8

Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 15, 2014, 7:04:11 PM10/15/14
to jzebra...@googlegroups.com
new image:

image: 
dimension 250x50
Bit Depth 1

Tres Finocchiaro

unread,
Oct 15, 2014, 8:43:12 PM10/15/14
to jZebra users
It may be an incompatibility with your printer.  If you can find an example of the image command, we can add support for your printer, but I'm very surprised it's not working.

Can you try with a very small image (i.e. 64x64) and use PNG as to remain constant with our sample.html.

Also, I'm not suure where the "ESC *" command comes from.  Despite the misleading error message, that's not an available choice for appending images, it should be ESCP.


Note that the while() syntax is bad and is deprecated, continue to use qzDoneAppending approach instead.

If is is indeed a compatibility issue, please help find a proper ESCP image example for your printer, we can add the necessary functionality to the applet.

-Tres

--
--
To unsubscribe from this group, send email to jzebra-users...@googlegroups.com
 
http://code.google.com/p/jzebra

---
You received this message because you are subscribed to the Google Groups "jZebra users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jzebra-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 16, 2014, 2:07:50 PM10/16/14
to jzebra...@googlegroups.com
hi, Tres i test using a small image

64x64 PNG
1 - bit depth

qz.appendImage(getPath() + "resources/images/logos/test/3.png","ESCP", "single");
qz.appendImage(getPath() + "resources/images/logos/test/3.png","ESCP" );

same result

image recipient attached to the reply

El viernes, 5 de octubre de 2012 09:30:28 UTC-4, adrian hurtado escribió:
3.png
recipien.JPG

Tres Finocchiaro

unread,
Oct 16, 2014, 2:15:41 PM10/16/14
to jZebra users
Which OS are you using?  Also, is your printer setup according to our setup guide (as a raw printing device?)



Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 16, 2014, 2:29:31 PM10/16/14
to jzebra...@googlegroups.com
EPSON TM-U220PD
Model 188D

1 - Connected to LTP1
2 - Generic/Text print driver
3 - Rename to ZEBRA
4 - Share print as ZEBRA on the network
5 - net use LPT1 \\pcprinter\ZEBRA

this is my configuration in this moment!

Tres Finocchiaro

unread,
Oct 16, 2014, 3:28:29 PM10/16/14
to jZebra users
I'm confused.... Why are you sharing it on the network if you have it connected locally?

You should be able to add a local port pointing to LPT1.  Sharing it on the network is only necessary if you have an old program which is hardcoded to LPT1.

-Tres

--

Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 16, 2014, 3:48:21 PM10/16/14
to jzebra...@googlegroups.com
my pc don't have lpt1 port 

Tres Finocchiaro

unread,
Oct 16, 2014, 4:12:38 PM10/16/14
to jZebra users
I'm not sure what you mean.  Why are you using LPT1 to begin with?  Are you testing your printing via command line?  There's very few reasons to use the legacy LPT1 handle.

Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 16, 2014, 4:49:32 PM10/16/14
to jzebra...@googlegroups.com
ok, Tres again sorry for the troubles and problems and thanks for your time and help

1 - I tried printing from the PC that has the printer connected directly to the port LPT1( Same result)
2 - I enable console log and i see this

WARNING: Tried calling JavaScript function "qzDoneFinding(...)" through web browser but it has not been implemented (Object "qzDoneFinding" does not exist or is not a function.)
Oct 16, 2014 4:40:12 PM qz.LogIt log
INFO: Loading BufferedImage
Oct 16, 2014 4:40:12 PM qz.LogIt log
INFO: Dimensions: 64x64
Oct 16, 2014 4:40:12 PM qz.LogIt log
INFO: Initializing Image Fields
Oct 16, 2014 4:40:12 PM qz.LogIt log
INFO: Converting image to monochrome
Oct 16, 2014 4:40:12 PM qz.LogIt log
INFO: Packing bits
Oct 16, 2014 4:40:12 PM qz.LogIt log
INFO: Current printer charset encoding: windows-1252
Oct 16, 2014 4:40:12 PM qz.LogIt log
WARNING: Copies is unsupported for print()
java.lang.UnsupportedOperationException: Copies attribute for raw data has not yet been implemented
at qz.PrintRaw.setCopies(PrintRaw.java:503)
at qz.PrintRaw.setPrintParameters(PrintRaw.java:523)
at qz.PrintApplet.getPrintRaw(PrintApplet.java:1367)
at qz.PrintApplet.startJavaScriptListener(PrintApplet.java:198)
at qz.PrintApplet.access$000(PrintApplet.java:64)
at qz.PrintApplet$1.run(PrintApplet.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at qz.PrintApplet.run(PrintApplet.java:143)
at java.lang.Thread.run(Unknown Source)

Oct 16, 2014 4:40:12 PM qz.LogIt log
INFO: Print buffer has been cleared.
Oct 16, 2014 4:40:12 PM qz.LogIt log
INFO: Successfully called JavaScript function
    setTimeout(qzDoneAppending(), 0)
Oct 16, 2014 4:40:12 PM qz.LogIt log
INFO: ===== SENDING DATA TO THE PRINTER =====
Oct 16, 2014 4:40:12 PM qz.LogIt log
INFO: 

3 * @

Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 16, 2014, 6:36:19 PM10/16/14
to jzebra...@googlegroups.com
i test the sample.html on the  PC that has the printer connected directly to the port LPT1
same result 

Tres Finocchiaro

unread,
Oct 17, 2014, 8:42:21 AM10/17/14
to jZebra users
@Arnaldo,

If image printing is not working then there must be a compatibility issue with your hardware.  If you can mail me incidental hardware, or provide ESCP image printing instructions for that printer we can proceed to fix it in the print applet.  We currently test on the TM88 series printers, so the TM-U220 must have some compatibility differences (I'm very familiar with the TM-U220 hardware, but have never tried printing to it from qz-print before).

Otherwise, you may find a conversion utility which prepares the bitmap data for your in the correct format (use base64 encoding so that JavaScript is happy), and then use append64(), which the applet does currently support.

-Tres

Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 17, 2014, 9:03:45 AM10/17/14
to jzebra...@googlegroups.com
thanks Tres for your help

I think the problem is that the TM88 is thermal and the TM-U220 is point matrix
i will test the append64

Tres Finocchiaro

unread,
Oct 17, 2014, 9:09:09 AM10/17/14
to jZebra users
@Arnaldo,

I'm looking up the specs on this printer and the print buffer is very small (40 bytes).

Can you try appending an image which is 32 pixels wide?  I looked up the specifications and I can't find anything that would suggest that our existing ESC * commands won't work on it.

-Tres

Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 17, 2014, 11:14:03 AM10/17/14
to jzebra...@googlegroups.com
Image
4.png
32x32 
bit depth 1
same result :(
using the command qz.appendImage(getPath() + "resources/images/logos/cpago/4.png","ESCP", "single");
attempt to base64?

Tres Finocchiaro

unread,
Oct 17, 2014, 2:31:35 PM10/17/14
to jZebra users
You can use base64, but without the appropriate image commands, you'll only get text on the paper.

Arnaldo Rafael Gonzalez Jimenez

unread,
Oct 17, 2014, 2:52:33 PM10/17/14
to jzebra...@googlegroups.com
I will continue investigating 
thanks for all your time

chechovr

unread,
Mar 11, 2015, 10:42:13 AM3/11/15
to jzebra...@googlegroups.com

same error with epson tmu220 - testing with posted images and same result, the printer only prints unknow caracters :(

Tres Finocchiaro

unread,
Mar 11, 2015, 12:00:44 PM3/11/15
to jZebra users
After several emails, it is my belief that our image commands are incompatible with the TM U220 series printers.  We'd be happy to offer support for this if we can obtain a programming guide with the proper commands.

-Tres
On Wed, Mar 11, 2015 at 10:42 AM, chechovr <chec...@gmail.com> wrote:

same error with epson tmu220 - testing with posted images and same result, the printer only prints unknow caracters :(

--

Tres Finocchiaro

unread,
Mar 11, 2015, 12:03:55 PM3/11/15
to jZebra users
FYI - I double checked and found that the manual linked in the original email has this note in the commands area:

Inline image 1

chechovr

unread,
Mar 11, 2015, 3:28:16 PM3/11/15
to jzebra...@googlegroups.com
my tm u220 never print a picture??

Tres Finocchiaro

unread,
Mar 11, 2015, 3:55:09 PM3/11/15
to jZebra users
my tm u220 never print a picture??

I don't know.  You can probably ask Epson.

-Tres

chechovr

unread,
Mar 11, 2015, 4:21:02 PM3/11/15
to jzebra...@googlegroups.com
but in the manual says this.. epson tmu220 support print images
Clipboard02.jpg

Tres Finocchiaro

unread,
Mar 11, 2015, 5:16:25 PM3/11/15
to jZebra users
On Wed, Mar 11, 2015 at 4:21 PM, chechovr <chec...@gmail.com> wrote:
but in the manual says this.. epson tmu220 support print images

--

chechovr

unread,
Mar 11, 2015, 6:14:46 PM3/11/15
to jzebra...@googlegroups.com

any solution to this bug friend???? or how can i correct this fail..

Tres Finocchiaro

unread,
Mar 11, 2015, 6:28:55 PM3/11/15
to jZebra users

If you need it right now, change the code and recompile for your own needs.

chechovr

unread,
Mar 11, 2015, 6:54:08 PM3/11/15
to jzebra...@googlegroups.com
thanks... ill' wait for the next version (update)... and thanks again for ur time..... its the best software!!

chechovr

unread,
Mar 14, 2015, 10:28:22 AM3/14/15
to jzebra...@googlegroups.com
how can i download de code to recompile

Tres Finocchiaro

unread,
Mar 14, 2015, 2:39:03 PM3/14/15
to jZebra users

chechovr

unread,
Mar 31, 2015, 1:44:09 PM3/31/15
to jzebra...@googlegroups.com

if u can help with the code... please...
Reply all
Reply to author
Forward
0 new messages