escpos-coffee icon indicating copy to clipboard operation
escpos-coffee copied to clipboard

Strange behavioue

Open sKY02644 opened this issue 2 years ago • 7 comments

Steps to Reproduce

just strange behaviour

  1. ... No idea how to as it might it working on all other machines just one

Evidences

SO EVERY THING IS WORKING FINE EVEN AFTER BUILD FOR PRODUCTION BUT THERE IS ONE MACHINE THAT SHOWS PRINTING THE DOCUMENT BUT THE DOCUMENT IS NEVER PRINTED AND NO ERRORS ARE SHOWN TO.

PLEASE ASSIST ME DEBUG IM KINDA CONFUSED

sKY02644 avatar Aug 16 '22 12:08 sKY02644

I TRIED THE PRINTER FROM A DIFFERENT MACHINE AND IT PRINTED SO THE PRINTER IS NOT FAULTY

I ALSO TRIED TO USE THE SAME JAVA VERSION GOT THE SAME BEHAVIOUR

IM REALY CONFUSED

sKY02644 avatar Aug 16 '22 12:08 sKY02644

I JUST NOTICED ANOTHER MACHINE IS HAVING THE SAME PROBLEM NO ERRORS DOCUMENT IS BEEN SENT TO PRINTER BUT ITS NOT PRINTING

sKY02644 avatar Aug 16 '22 12:08 sKY02644

Hi @sKY02644 , We have some clues.

  • Some machines is printing well
  • Other ones are not printing and does not show error.

If you are not using PrinterOutputStream, disregard the answer!

Ok, if are you using PrinterOutputStream, it can be reproduced by installing one printer on system (with no real printer connected to it)

How to reproduce: In my ubuntu machine, I have one good and real printer installed (TM-T20), and other fake printer (CUPS-BRF-Printer) as you can see on screenshot.

Both printers is listed on PrinterOutputStream.getListPrintServicesNames(), and can be used as "printer name" without error, but only TM-T20 send content to the printer!

java -jar getstart-4.1.0-jar-with-dependencies.jar 
Usage: java -jar getstart.jar ("printer name")
Printer list to use:
CUPS-BRF-Printer
TM-T20

Solution If it is your case, the solution is simple: just ensure that the printer is correctly installed on the system.

Screenshot from 2022-08-16 10-04-52

anastaciocintra avatar Aug 16 '22 13:08 anastaciocintra

@anastaciocintra THANK YOU FOR THE QUICK REPLY

PrintService printService = PrinterOutputStream.getDefaultPrintService();

I AM ACTUALLY USING THE PrinterOutputStream AND THE PRINTERS ARE XPRINTER PRINTERS THE PRINTERS ARE INSTALLED CORRECTLY

sKY02644 avatar Aug 16 '22 13:08 sKY02644

THE APPLICATION HANGS AWAITING FOR THE PRINTING TO COMPLETE BEFORE IT CONTINUES AND SINCE THE COMMAND IS SENT TO THE PRINTER BUT ITS NOT PRINTED

ALSO THE MACHINES PRITING , I JUST NOTICED ARE THE MACHINES WE USE FOR DEVELOPMENT WHEN WETEST THE PRODUCTION VERSION ON OTHER MACHINES IT SENDS COMMAND TO PRINTER AND SHOWS PRINTING STATUS BUT NEVER PRINTS

sKY02644 avatar Aug 16 '22 13:08 sKY02644

@sKY02644 , I could be wrong, and that we have a bug in the lib, but, In my humble opinion, you have environment differences, something like:

  • the printer itself: same brand / model / interface, etc;
  • profile of user in production in general have less power in comparison with development profile;
  • java version and configuration on desenv / production differences;

anastaciocintra avatar Aug 16 '22 19:08 anastaciocintra

  1. ALL THE PRINTERS WHERE TESTED WITH THE SAME DRIVERS ON A WORKING MACHINE AND ALL WORKED

QUICK SIDE NOTE WE ARE CALLING THE JAR FILE FROM AN ELECTRON APP WHICH WE USING THE java-caller MODULE TO CALL THE JAR FILE

ALL JAVA VERSIONS ARE THE SAME ACROSS ALL THE MACHINES

THIS JAR FILE READS A .JONS FILE WHICH IT DOES AND GENERATES THE RECEIPTE AND SENDS IT TO THE DEFAULT PRINTER

sKY02644 avatar Aug 16 '22 22:08 sKY02644