如何从 Web 应用程序打印到收据打印机? [英] How to print from web application to receipt printer?
问题描述
我的客户要求我在 Epson TM U220 上打印收据 ( 库,将 jar 文件放在项目目录中,然后你好:
<applet name="jzebra" code="jzebra.PrintApplet.class" archive="./jzebra.jar" width="100" height="100"><param name="printer" value="zebra"></小程序><脚本>功能打印(){document.jzebra.append("使用 JZEBRA 打印
");document.jzebra.print();}
I was asked by my client to print receipts on an Epson TM U220 (http://pos.epson.com/products/TM-U220.htm) from my web application. I have no idea how to do that. Are there any java applets or something else that I can use for printing? Should i use JasperReports? (Does JasperReports help to cope with this problem?) If there are flash apps that could be used, I have no objection to using that.
I am using Grails for my web apps.
To get this working, simply setup your receipt printer as the default printer and rename it as "zebra":
Then simply download the jZebra library, put the jar file in the project directory and hey presto:
<input type=button onClick="print()" value="Print">
<applet name="jzebra" code="jzebra.PrintApplet.class" archive="./jzebra.jar" width="100" height="100">
<param name="printer" value="zebra">
</applet>
<script>
function print() {
document.jzebra.append("PRINTED USING JZEBRA
");
document.jzebra.print();
}
</script>
这篇关于如何从 Web 应用程序打印到收据打印机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!