javax.print.PrintException:打印机不接受作业

发布于 2024-10-09 14:48:01 字数 621 浏览 0 评论 0原文

我收到“javax.print.PrintException:打印机不接受作业。”,当我尝试执行时,

printService.createPrintJob().print(
                    new SimpleDoc(this,
                            DocFlavor.SERVICE_FORMATTED.PRINTABLE,
                            docAttributeSet),
                    printRequestAttributeSet);

我发现一台机器打印到打印机时发生此问题,但另一台机器可以使用相同的 API 调用打印到同一台打印机。我正在查看 Oracle Sun 的错误报告,解释了类似的问题,粘贴在下面。 https://bugs.java.com/bugdatabase/view_bug?bug_id=6525150

但其中提到的解决方法都没有为我解决问题。任何帮助表示赞赏。

I am getting the "javax.print.PrintException: Printer is not accepting job.", when I try to execute

printService.createPrintJob().print(
                    new SimpleDoc(this,
                            DocFlavor.SERVICE_FORMATTED.PRINTABLE,
                            docAttributeSet),
                    printRequestAttributeSet);

I am seeing this problem happening for one machine printing to the printer but the other machine is able to print to the same printer using the same API call. I was looking at bug report from Oracle Sun explaining similar problem which is pasted below.
https://bugs.java.com/bugdatabase/view_bug?bug_id=6525150

But none of the workarounds mentioned there is fixing the problem for me. Any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

苍暮颜 2024-10-16 14:48:01

删除并添加打印机可修复错误中提到的问题作为解决方法。这对我有用。

Removing and adding the printer fixes the problem as mentioned in the bug as a workaround. It worked for me.

十雾 2024-10-16 14:48:01

printerName=printerName.replaceAll("#", "\\");

不要使用默认打印机,如果打印机是默认打印机,则将 '#' 替换为 '//'。由于窗口系统我得到了这个异常,我已经使用上面的代码替换了我的打印机名称,我的问题现在已经解决了。

printerName=printerName.replaceAll("#", "\\");

don't use the default printer and if the printer is default one then replace '#' with '//'. Due to window system I got this exception, I have replaced my printer name by using the above code and my problem is now solved.

轮廓§ 2024-10-16 14:48:01

虽然这无法解决报告的问题(一台打印机工作而另一台打印机出现故障),但如果打印机由于系统问题(例如打印机碳粉用完)而变得不可用,则可能会报告此错误。在这种情况下,更换碳粉应该可以解决问题。

While this won't resolve the reported issue (where one printer works and the other fails), this error can be reported if the printer becomes unavailable due to a systemic issue, such as if the printer runs out of toner. In this event, changing the toner should solve it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文