Guide on creating a Java Applet , Printing without prompt

好久不见. 提交于 2019-12-19 09:28:26

问题


Well I have created a web-based POS to take order. My question is how do I create a Java-Applet;

  1. Shows the HTML page & a Print button
  2. 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


回答1:


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.




回答2:


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/



来源:https://stackoverflow.com/questions/8440687/guide-on-creating-a-java-applet-printing-without-prompt

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