Hello,
I am trying to print a PDF directly with the Apache PDFbox API on the iSeries.
This is my Java Code:
public static void Print_File_(String File) throws IOException, PrinterException { PrinterJob printJob = PrinterJob.getPrinterJob(); PrintService[] printServices = PrinterJob.lookupPrintServices(); for(PrintService printService : printServices){ System.out.print(printService.getName()); if(printService.getName().contains("Kyo1030_hwcg")){ printJob.setPrintService(printService); break; } } PDDocument doc = PDDocument .load(File); doc.silentPrint(printJob); }
The function PrinterJob.lookupPrintServices(); throws the following Exception if the application is installed on the WAS 8.5.5 (iSeries)
In the test environment (Windows) it works....
[21.07.15 13:41:57:338 CEST] 00000094 SystemErr R 21.07.2015 13:41:57.1 EGL1622E:EGL1622E Bei dem Versuch, Funktion PDF_005fPRINT f�r EGL-Service print_pdf_service aufzurufen, ist ein Fehler aufgetreten. EGL0001I Der Fehler ist in print_pdf_service aufgetreten. detail1:500 detail2:FAILED detail3:java.awt.print.PrinterException:No print service found.
Kind regards,
Marcel!
Marcel-D