lokeshj / jzebra

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

Print to PORT instead of PRINTER NAME? #128

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Greetings,

I love the library, I was just wondering if it were possible to print through a 
port name instead of a printer name?  My plant is currently using an ActiveX 
control to print via javascript, but I've been looking for alternatives.  This 
method printed through PORT name instead of PRINTER NAME.

Thanks!

Original issue reported on code.google.com by ebo...@nysus.net on 19 Apr 2013 at 2:30

GoogleCodeExporter commented 9 years ago
This is an indirect solution to what you are trying to achieve, but I would 
recommend writing a script that adds a local printer for each physical com port 
and then using the printer name. (i.e. Printer name COM_5 could always print to 
physical COM5, etc).

If you absolutely need direct COM port access, keep reading, I cover that topic 
below.

Assumign you are follow this tutorial:
https://code.google.com/p/jzebra/wiki/TutorialRawXP when prompted for the port 
use the COM or LPT port rather than the IP address.

Selecting the physical COM port from within the web page instead of printer 
name requires RS232 communication through a 3rd party library.  This can get 
ugly because jzebra has to open and close the serial port.  Experimental RS232 
support is being written currently using the jSSC library but is not yet stable 
enough for daily use.  jSSC may have a stand-along solution that works for your 
needs.   https://code.google.com/p/java-simple-serial-connector/

*Note:  In Windows 8 printing to COM ports can be found in the "Advanced 
printer setup", "Local Printer or Network Printer" which can be found in the 
control panel.

-Tres

Original comment by tres.fin...@gmail.com on 19 Apr 2013 at 2:42

GoogleCodeExporter commented 9 years ago

Original comment by tres.fin...@gmail.com on 19 Apr 2013 at 2:42

GoogleCodeExporter commented 9 years ago
Brilliant response time and great explanation.  Your explanation is precisely 
why we want to get away from the old ActiveX + driver setup, not to mention 
it's a closed system.  Thanks!

Original comment by ebo...@nysus.net on 19 Apr 2013 at 2:45

GoogleCodeExporter commented 9 years ago
Leave this bug open, since printing directly to a COM port is a desired feature 
of the applet.

-Tres

Original comment by tres.fin...@gmail.com on 19 Apr 2013 at 4:03