Runtime exec lp command print success

故事扮演 提交于 2020-01-17 08:53:16

问题


I have to print a PDF file in java program and make sure it's printed successfully, else throw exception.

My Code is:

Process p = Runtime.getRuntime().exec("lp -c -n 1 -d 1.2.3.4 abc.pdf");
System.out.println(p.waitFor());

Above code prints 0, but it only confirms that job is submitted fine, how to make sure that it's printed also.

Is there any other way to do this?


回答1:


Run lpstat (after lp) and capture the process output.



来源:https://stackoverflow.com/questions/14616733/runtime-exec-lp-command-print-success

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!