如何使用Java Applet将原始数据发送到打印机

时间:2012-09-12 19:25:41

标签: html printing applet

先谢谢。

我是Java Applet的新手,我会告诉我的要求,希望能得到解决方案。

这是我的Html编码

<html>
<head><title>Test Print Via Applet</title></head>
<body>
<div id="text_to_print">
This is my Office<br />
This is my Office Address<br />
<center>Header of the Receipt</center><br />
1. Product 1          100.00<br />
2. Product 2          200.00<br />
                      ------<br />
TOTAL                 300.00<br />
                      ------<br />
Thanks for the Purchase.
</div>
<input type="button" value="Print Directly to the Dot Matrix by using Applet" />
</body>
</html>

现在,如果有人点击按钮,“text_to_print”div中的竞争应该直接在点阵打印机中打印而不需要打印机对话框。

我的一位朋友告诉我,如果我们使用Applet,这是可能的。我在互联网上搜索这个问题,但仍然无法为我提供正确的解决方案。

请帮我解决这个问题。

再次感谢。

1 个答案:

答案 0 :(得分:0)

https://code.google.com/p/jzebra/ 提供一个很好的界面,通过JavaScript与打印机通信。最终java applet完成了这项工作。