一个开源的支持IPP打印的项目,jipsi 包中包括了打印PDF文件到网络打印机的例子和测试。
CUPS是Mac OS® X and other UNIX®-like系统中打印开源项目
在windows 我们可以使用这个包来使用网络打印机
例子:
URI printerURI = new URI("ipp://SERVER:631/printers/PRINTER_NAME");
IppPrintService svc = new IppPrintService(printerURI);
InputStream stream = new BufferedInputStream(new FileInputStream("image.epl"));
DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
Doc myDoc = new SimpleDoc(stream, flavor, null);
DocPrintJob job = svc.createPrintJob();
job.print(myDoc, null);