Closed GoogleCodeExporter closed 9 years ago
function cutPaper() { //without the if statement in your case
document.qz.append(chr(27) + chr(105)); // cuts paper
}
Original comment by adomv...@gmail.com
on 14 Jan 2014 at 11:06
Thank you for the detailed bug report. The printer may be auto-detecting
character encoding/character table.
What printer model do you have? Is there a command to force a particular
character table?
Here is a link to Epson ESC/POS character tables:
http://support.epson.ru/products/manuals/000350/part1.pdf#page=80
Let me know if this helps.
-Tres
Original comment by tres.fin...@gmail.com
on 14 Jan 2014 at 2:49
To set character table I used the command setEncoding("CP869"); as described on
the code snippet.
The printer is an OEM Chinese POS printer that supports ESC/P commands.
Character encoding/character table are different things and are set with
different commands?
Should I use any other commands in the beginning or end of the script is order
to be able to set the encoding?
Thank you!
Original comment by adomv...@gmail.com
on 14 Jan 2014 at 3:16
> To set character table I used the command setEncoding("CP869"); as described
on the code snippet.
That only sets encoding for Java. Your printer's internal charset is not
affected by this command. You still have not stated which printer make/model
you are using.
-Tres
Original comment by tres.fin...@gmail.com
on 14 Jan 2014 at 3:35
The printer is called XP-80C.
It is a Chinese printer simulating the EPSON printers.
About the setEncoding("CP869");
I thought it was also setting the encoding for the printer internally.
So I have to set the encoding to Greek with esc/p commands too.
I will take a look at the manual and I will let you know which commands did the
job.
Do these commands differ from model to model of printer?
Thank you!
Original comment by adomv...@gmail.com
on 14 Jan 2014 at 3:48
> I thought it was also setting the encoding for the printer internally.
No, not in the current version.
> Do these commands differ from model to model of printer?
Yes, they can. ESC/POS is pretty well established standard, but the
manufacturer's implementation of it will vary.
The applet is also used for other languages such as EPL, CPCL, ZPL, FGL, DPL,
but ESC/POS compatible printers tend to have a high compatibly rate with
each-other (and they are usually advertised in this fashion).
-Tres
Original comment by tres.fin...@gmail.com
on 14 Jan 2014 at 3:57
I have added in the beginning of the code the following command to set encoding.
The following command seems to be dependent on my printer model. As other
printer models have different command to set the character table.
applet.appendHex("x1Bx40x1Cx2E");
applet.appendHex("x1Bx21x00x6C");
Are you able to decode and understand the commands above? I have found them
online and pasted and luckily they work.
These seems to be working, as the Greek chars are printed fine each time and
also the bug I mentioned seems to have dissappeared.
The issue remaining now, is the fact the these 2 commands caused the barcode to
stopped from being printed.
Could you please reproduce this on your printer if possible?
Or do you see any reason why the barcode stopped working?
Thank you!
Original comment by adomv...@gmail.com
on 14 Jan 2014 at 6:25
Without your programmer's guide, I cannot understand your commands.
I have an Epson TM88V I can test on, but you should probably post the question
to jzebra-users@googlegroups.com as there are many experienced ESC/P users that
don't look at the bug tracker.
-Tres
Original comment by tres.fin...@gmail.com
on 14 Jan 2014 at 7:02
Ok I will try ssending my script snippet there too.
Let me know if the barcode works on your Epson printer too if you can.
Thank you!
Original comment by adomv...@gmail.com
on 14 Jan 2014 at 7:15
@Anestis,
This took me a while, but was successful. Here are my results:
http://i.imgur.com/Djpso7D.jpg
I noticed a typo in your example. You sent the cut receipt command after you
called print(), but instead, it should come before print().
I used setEncoding("IBM869") and then appendHex("x1Bx74x26")and the rest was
straight forward.
The only command that may differ with your hardware is the x1Bx74x26. I
couldn't find a Greek character table reference documented for my hardware
anywhere. So I took it upon myself to write a while loop printing Greek
characters and incrimenting the command until I came to a working hex value of
x26.
I believe older versions of ESCP had limited memory, so they only stored 4
character table references in ram. First, I tried experimented with the old
syntax, which overwrites slot 0, 1, 2, 3 in RAM, since it offered backwards
compatibility, but I couldn't get the command to do anything.
In addition, I show the examples using Greek as well as Escaped Unicode, which
may help others down the road.
-Tres
function printGreek() {
// Greek charset
qz.setEncoding("IBM869");
// Select character code table CP869, Table 38 on Epson TM88V (x26)
// Format: <ESC> <GS> t <value>
qz.appendHex("x1Bx74x26");
// Left align
qz.appendHex("x1Bx61x00");
qz.append("Greek typed directly into text editor:\r\n");
// Append greek text
qz.append(" Πληροφορίες\r\n\r\n");
qz.append("Greek encoded (ANSI safe):\r\n");
// Append ansi-safe greek text, converted to unicode
qz.append(" \u03A0\u03BB\u03B7\u03C1\u03BF\u03C6\u03BF\u03C1\u03AF\u03B5\u03C2\r\n\r\n");
qz.append("Greek typed directly into text editor:\r\n");
// Append greek text
qz.append(" Το στίγμα ενδέχεται να μην είναι ακριβές\r\n\r\n");
qz.append("Greek encoded (ANSI safe):\r\n");
// Append ansi-safe greek text, converted to unicode
qz.append(" \u03A4\u03BF \u03C3\u03C4\u03AF\u03B3\u03BC\u03B1 \u03B5");
qz.append("\u03BD\u03B4\u03AD\u03C7\u03B5\u03C4\u03B1\u03B9 \u03BD");
qz.append("\u03B1 \u03BC\u03B7\u03BD \u03B5\u03AF\u03BD\u03B1\u03B9 ");
qz.append("\u03B1\u03BA\u03C1\u03B9\u03B2\u03AD\u03C2\r\n\r\n");
// Feed 2 lines
qz.append("\r\n\r\n");
// Center Align
qz.appendHex("x1Bx61x01");
// Append a black and white image
qz.appendImage(getPath() + 'img/image_sample_bw.png', 'ESCP', 'double');
// Wait for image to finish appending
window["qzDoneAppending"] = function () {
// Feed 20 lines
qz.append("\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n");
qz.append("\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n");
// Cut receipt
qz.appendHex("x1Bx69");
// Send commands to printer
qz.print();
// Remove reference to this function
window["qzDoneAppending"] = null;
};
}
Closing bug and marking as invalid. Please re-open if you believe this was
closed in error.
-Tres
Original comment by tres.fin...@gmail.com
on 15 Jan 2014 at 4:52
Issue 130 has been merged into this issue.
Original comment by tres.fin...@gmail.com
on 20 Jan 2014 at 1:21
Issue 88 has been merged into this issue.
Original comment by tres.fin...@gmail.com
on 20 Jan 2014 at 1:21
Issue 165 has been merged into this issue.
Original comment by tres.fin...@gmail.com
on 20 Jan 2014 at 1:22
Original issue reported on code.google.com by
adomv...@gmail.com
on 14 Jan 2014 at 10:57