0

I want to print some simple text to a POS printer (many different models) from a browser. There might be different models but the sure thing is that the printer will be connected into a windows computer and have its drivers installed. The printer might be connected via usb. So, I want the user of the Windows computer to be able to press a button (one click) in my web application and print to the specific POS printers. The web app is written in php and uses jquery. So what I am asking, is how is this possible, and which is the easiest and best way to do that. Should I use javascript or what else? Is there a library? Will I face compatibility issues, if there are multiple pos printer models?

4

1 回答 1

0

根据您的确切设置,此 pecl 扩展可能是您需要的。

您需要在每台机器上使用通用共享名称共享打印机,当您连接到打印机时,您可以使用 $_SERVER['REMOTE_ADDR'] 构建 unc 以访问打印机。

另一种选择是,如果所有打印机都使用相同的页面定义语言(如 postscript),那么您可以使用类似这样的库来创作文档,将其转储到临时文件并使用系统 lpr 调用将其发送到打印机

于 2013-06-13T06:51:39.220 回答