Ready to Print? Zebra QLN 420 C# and Java Code?

Hi all

 

Anyone have a piece of code for check the status of the printer?

i want check via ip, actually the ip of the printer is: 172.16.11.207

in C# and Java, i have this code:

 

public String getStatus (String Printerchosen)

 

//Printerchosen = Printer Driver Name

      {

            try{

            com.zebra.sdk.comm.Connection myconnection = new com.zebra.sdk.comm.DriverPrinterConnection(Printerchosen,1000,1000);

            myconnection.open();

            com.zebra.sdk.printer.ZebraPrinter myprinter =ZebraPrinterFactory.getInstance(myconnection);

    

            com.zebra.sdk.printer.PrinterStatus printStatus = myprinter.getCurrentStatus();

            myconnection.close();

            if (printStatus.isReadyToPrint)

            {

                  return"READY TO PRINT";

            }

            else

            {   

                  return"Not Ready!!";

            }

          

          

            }

            catch (Exception f)

            {

                  f.printStackTrace();

          

                  return"Problem found";

            }


But isnt for a ip printer.


Thanks

          

 

    

      }