| 
 | 
Hi,
try Google on some of the following and I guess that you will get a lot of hits:
DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
/* locate a print service that can handle it */
PrintService[] pservices = PrintServiceLookup.lookupPrintServices(flavor, aset);
/* create a print job for the chosen service */
DocPrintJob pj = pservices[printnbr].createPrintJob();
try {
/* * Create a Doc object to hold the print data.
* Since the data is postscript located in a disk file,
* an input stream needs to be obtained
* BasicDoc is a useful implementation that will if requested
* close the stream when printing is completed.
*/
FileInputStream fis = new FileInputStream(filename);
Doc doc = new SimpleDoc(fis, flavor, null);
/* print the doc as specified */
pj.print(doc, aset);
:
:
:
-----Original Message----- From: Rick DuVall [mailto:R_C_DuVall@xxxxxxxxxx] Sent: Thursday, February 1, 2007 03:07 PM To: java400-l@xxxxxxxxxxxx Subject: Printing in Java Hi Group, I have written several swing apps (desktop client -> iSeries-i5-whatever), but have never used java to print anything. I now have a need to produce print-out on a little thermal printer as part of the new app I'm working on. Can anybody point me in the right direction? What I've found so far seems a bit convoluted. ;) Of course much of java has struck me that way... <smile> I continue to dig, but pointers are always welcome. Thanks in advance! Regards, Rick DuVall Systems Manager Dealer's Auto Auction of Okc, Inc. <mailto:rick@xxxxxxxxxx> rick@xxxxxxxxxx (405) 947-2886 <http://www.nothingisreal.com/dfki/no-word> http://www.nothingisreal.com/dfki/no-word -- 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-2025 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.