samuraiza / jzebra

Automatically exported from code.google.com/p/jzebra
0 stars 0 forks source link

printer Status Esc/p #209

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
How to retrieve the printer status.

I have tried to send the esc/p command "DLE EOT" by append method.
but all it returns is "undefined"

do you have any suggestions.

Kind Regards 
Rene

Original issue reported on code.google.com by rene.ker...@gmail.com on 20 Feb 2014 at 9:34

GoogleCodeExporter commented 9 years ago
"undefined" is generally a sign that the applet is not loaded properly.

Are you working from the sample.html?  If so, which version?  if not, please 
post a snippet of code.

-Tres

Original comment by tres.fin...@gmail.com on 20 Feb 2014 at 1:19

GoogleCodeExporter commented 9 years ago
Tres

This is the function from the application.
The applet is loaded properly and working.
Version: QZ-PRINT 1.6.6

function monitorPrinting() {
    var qz = document.getElementById('qz');
    if (qz.tagName.toLowerCase() == "applet") {
        if (!qz.isDonePrinting()) {
            window.setTimeout('monitorPrinting()', 1000);
        } else {
            var e = qz.getException();
            if (e != null) {
                alert(qz.append("<?php echo chr(16).chr(4).chr(3)?>"));
                alert("printing exception occured ", e.getLocalizedMessage(),'error');
            }
        }
    } 
}

Original comment by rene.ker...@gmail.com on 21 Feb 2014 at 10:02

GoogleCodeExporter commented 9 years ago
The printer spooler is mostly unidirectional, so printer "status" is never 
returned over the wire for conventional use of the applet.

You may have success using bi-directional communication with the serial 
support, but I'm unaware if anyone has successfully done this.

qz.append returns Java "void" (or undefined/null in JavaScript), so at this 
time you will not be able to get the printer status.

-Tres

-Tres

Original comment by tres.fin...@gmail.com on 21 Feb 2014 at 1:42

GoogleCodeExporter commented 9 years ago
Thank you Tres,
I was suspecting that the append method hasn't got a return.
Rene
Op 21 feb. 2014 14:42 schreef <jzebra@googlecode.com> het volgende:

Original comment by rene.ker...@gmail.com on 21 Feb 2014 at 6:06