Nathan Meyers wrote:
>
> On Wed, Jan 31, 2001 at 05:40:18PM -0500, Joseph Shraibman wrote:
> > Just open it like you would any other file.
>
> No... you need an extension that lets you drive the device. The JavaComm
> extension does this. A Linux version of JavaComm is available from the
> Blackdown site but, last I saw, serial support was there but parallel
> support was not.
Not for simple I/O. The following code is from a barcode label class
and has been used in our shop to print literally *millions* of labels
on RJS and Prodigy barcode printers, where "printer.carton.device"
is "/dev/lp0" under Linux and "LPT1:" under W****** (depending on user
input in a setup dialog):
try {
os = new FileOutputStream ((String)Props.get("printer.carton.device"),
true);
pw = new PrintWriter(os, true);
pw.print ("~^" + q + "Carton Label" + q + ";" + df4.format(Labels));
// printable area 1.00", top-to-top length 1.125":
pw.println (";0;100;0;SPB;UTOF;1125;");
...
Of course, the user has to have permissions to the device.
--
===================================
Glenn Holmer ([EMAIL PROTECTED])
-----------------------------------
Don't say that you have no choice
With no one to hear your voice
You can shout and make no sound
Or whisper up a storm
-----------------------------------
-Robin Trower, 1994
===================================
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]