Jacopo Cappellato wrote:
David, all,

I'd like to clarify that this issue is not strictly related to OFBiz and service calls. It is an issue probably caused by my ignorance on the usage of the javax.print API:

http://java.sun.com/j2se/1.4.2/docs/api/javax/print/package-summary.html

DavidS said you were looking for code to discover lan printers. I definately don't understand the one-dimension java printing tools, but I posted two snippets of code at
http://forum.java.sun.com/thread.jspa?threadID=216673&start=17&tstart=0

Here's code to find printers that the machine the javaVM is running in knows about. This code works, but needs cleanups since I think it imports too much stuff. And I am NOT a java coder. This is only Proof of Concept.

<code>

import java.io.*;
import javax.print.*;
import javax.print.attribute.*;
import javax.print.attribute.standard.*;
import javax.print.attribute.AttributeSetUtilities.*;

public class Eltron3 {

        public static void main(String[] args) {
                PrintService psZebra = null;
                String sPrinterName = null;
PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
                for (int i = 0; i < services.length; i++) {
PrintServiceAttribute attr = services[i].getAttribute(PrinterName.class);
                        sPrinterName = ((PrinterName)attr).getValue();
System.out.println("Found printer: " + sPrinterName + "\n");
                }
                System.out.println("Finshed\n");
        }
}


</code>

See the link for the code to print to a named printer with a byte stream.
--
Walter

Reply via email to