aobag-dev / jzebra

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

Return print success or not status from printer #246

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
My application normally will print out label after saving the transaction. 
However, sometimes the record successfully save to database but no label 
printout. There are no error message return. So i would like to know is there 
any function to get the print success or not return from printer?

What version of the product are you using? On what operating system?
1.8

Original issue reported on code.google.com by chanway...@gmail.com on 6 May 2015 at 8:14

GoogleCodeExporter commented 8 years ago
> is there any function to get the print success or not return from printer?

Generally, you can use:

   function qzDonePrinting() {
     if (qz.getException()) {
        alert("error! ");
     }
   }

However, this doesn't actually tell you if the print was successful, but rather 
if the print was accepted by the spooler subsystem.

To know if the item actually printed may require accessing the hardware on a 
lower level.  This is something we plan to offer better support for after QZ 
Tray has been released.

Original comment by tres.fin...@gmail.com on 6 May 2015 at 12:14

GoogleCodeExporter commented 8 years ago
Hi tres,

Thanks for your quick respond.

I tried with the function you provided but no error or pop up message has been 
captured. My program can search for the printer and send the print command, but 
still there are some labels missed to print (3-5 out of 100).

Any other suggestion for me to further investigate the issue?
Thanks

Original comment by chanway...@gmail.com on 11 May 2015 at 7:55

GoogleCodeExporter commented 8 years ago
Are you using form posts to send data back to the server?  If so, you may be 
rewriting the DOM and removing the applet from the page briefly.  If this is 
the case, you may choose to use an AJAX method instead, or some of our 
customers run the print plugin in an iframe which prevents it from being force 
reloaded on HTTP post.

-Tres

Original comment by tres.fin...@gmail.com on 11 May 2015 at 6:54