5 Replies Latest reply on Jan 16, 2018 3:48 PM by Manuel Caicedo-Rivera

    Java print service is creating print job but print is not happening via zebra zp500 plus

    Dig Dub

      private static void printPdf(File filename) throws PrintException, IOException{

       

          PrintService ps = PrintServiceLookup.lookupDefaultPrintService();

          System.out.println(ps.getName());

          PrintService myService = ps;

          FileInputStream fis = new FileInputStream("C:\\PrintLabel\\File.pdf");

          Doc pdfDoc = new SimpleDoc(fis, DocFlavor.INPUT_STREAM.AUTOSENSE, null);

          DocPrintJob printJob = myService.createPrintJob();

          printJob.print(pdfDoc, new HashPrintRequestAttributeSet());

          System.out.println("print is called");

          fis.close();

       

      }