创建 Java Applet 指南,无提示打印
我已经创建了一个基于网络的 POS 来接受订单。我的问题是如何创建 Java-Applet;
- 显示 HTML 页面 & a 打印按钮
- 打印订单而不提示(无对话框)
附加信息: 它的工作原理如下。服务员从电脑(POS)上敲下订单,当他们点击打印时,它会检测厨房打印机的IP地址,然后立即打印出订单,无需任何提示。我实际上正在寻找可以帮助我开始的参考/指南。任何建议也会有所帮助。谢谢
Well I have created a web-based POS to take order. My question is how do I create a Java-Applet;
- Shows the HTML page & a Print button
- Print Order without prompting(no dialogue box)
Additional Information : It works like this. The waiter will key the orders from the computer(POS) , when they hit print, it will detect the I.P address of the printer in the kitchen,then print out the orders immediately without prompt. I am actually looking for reference/guide which can help me start on. Any Advise will be helpful as well. Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
出于安全原因,您不能这样做。如果可以的话,当您访问不道德的网站时,小程序可能会因为打印 10 多页“特别优惠”而臭名昭著。
OTOH,如果客户端愿意在小程序启动时接受一个提示,您可以对代码进行数字签名。
You cannot do that for security reasons. If you could, applets would already have become notorious for printing 10+ pages of 'special offers' when you visit unscrupulous web sites.
OTOH, if the client is willing to accept one prompt at applet start-up, you could digitally sign the code.
有一个项目使用 HTML5 进行 HTML 打印,将内容渲染为 PNG 和 Java 以便直接打印,正如原始帖子中所述。该项目称为“qz-print”(以前称为“jzebra”),它提供自签名(免费)和可信签名(收费)的数字签名。
它还使用签名的 JNLP 文件,如 Andrew Thompson 所示。 (谢谢 Andrew,您对 Java 整体的贡献对世界各地的 Java 开发人员来说是一个很大的帮助)。
https://code.google.com/p/jzebra/
There is a project that does HTML printing using HTML5 to render the contents to a PNG and Java to print directly, exactly as described in the original post. This project is called "qz-print" (previously called "jzebra") and it offers the digital signature in both self-signed (free) and trusted-signed (at a premium).
It also uses the signed JNLP files as Andrew Thompson has illustrated. (Thanks Andrew, your contributions to Java as a whole have been a great help to Java developers around the world).
https://code.google.com/p/jzebra/