anastaciocintra / escpos-coffee

Java library for ESC/POS printer
https://anastaciocintra.github.io/escpos-coffee
MIT License
277 stars 72 forks source link

How to print from laptop to the shared printer on a network? #73

Closed fgroupindonesia closed 2 years ago

fgroupindonesia commented 2 years ago

supposed i have these output after running the 1st example.

========= Printer Names:
Send To OneNote 2010
Microsoft XPS Document Writer
Master PDF Editor 5
Fax
eDocPrinter PDF Pro
\\spc-desktop\58mm Series Printer
========= end.

that one for the last \spc-desktop\58mm Series Printer I unable to connect java for printing by using it.

But if I used a normal casual classical java print API, especially printDialog(); everything works, including the shared printer. Because it through out the printDialog(); calls....

I wonder if this library escpos-coffee could also solving my current situation as well....

regards,

Gumuruh

anastaciocintra commented 2 years ago

I don't know how to help you, but I can review some points about printer name:

the installed printers can be listed by the command line:

java -jar getstart-4.1.0-jar-with-dependencies.jar 
>>>output of my linux machine ...

Usage: java -jar getstart.jar ("printer name")
Printer list to use:
cups_TM_T20_MacBook_Pro_de_Marco
EPSON_TM_T20_MacBook_Pro_de_Marco
TM-T20

and when you pass the "printer name" you can send only a substring of the printer name:

java -jar getstart-4.1.0-jar-with-dependencies.jar cups_tm

instead of

java -jar getstart-4.1.0-jar-with-dependencies.jar  "cups_TM_T20_MacBook_Pro_de_Marco"

the code can be found at: https://github.com/anastaciocintra/escpos-coffee-samples/tree/master/usual/getstart

fgroupindonesia commented 2 years ago

alright... thanks.