|
Just a suggestion about the escapes: make sure you are sending the right bytes, and not chars that look like the right bytes. If you send chars (or String data), that will be encoded into bytes, and the encoding may be unintuitive for non-text characters. Regards PC2 -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Rick DuVall Sent: February 2, 2007 08:54 To: 'Java Programming on and around the iSeries / AS400' Subject: RE: Printing in Java Hi Tamas, Thanks for the response - I am still trying to get this thing to work. I can print to a normal printer but can't seem to get the escape sequences right on the thermal - rpg does it fine but that may be because of the device setup. Anyway, I am fighting the configuration wars with it... I used the new FileOutputStream("LPT1") method and it seems to work but for the proper escapes. It will have to give up eventually <smile>. Thanks again. Regards, Rick
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Tamas Perlaky Hi Rick, The way I did it in the past with a line printer (which I had to access from several computers) was to share the line printer on a Win2K print server and then open the UNC path to the printer as an output file stream from my Java code. I think you could also print to open LPTx: or COMx: on the local machine as if they were files too, but I've not tried that in a while. If you want to get more sophisticated about it, you could try working with the parallel or serial port directly. This is something I've never tried personally, but if you want to give it a go then I'd suggest starting with http://www.rxtx.org/, which is a toolkit that allows this kind of stuff. Sun actually has an API for port access, but I don't think it's supported in Windows any more. (In all of this I'm assuming that your Java code will be running on Windows based on your Swing comments in the initial post... please let me know if I'm wrong.) t.
-- This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/java400-l or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.