Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP打印到外部收据打印机_Php_Point Of Sale_Printers - Fatal编程技术网

使用PHP打印到外部收据打印机

使用PHP打印到外部收据打印机,php,point-of-sale,printers,Php,Point Of Sale,Printers,我正在试图找到一个解决方案,将实时订单发送到收据打印机 基本上是伪代码: if ($order == 'success') { $printer = ip.to.remove.printer; $receipt_text = 'You just received an order!'; $ch = curl_init('http://addresstosomekindofapi.com/print_receipt/'); curl_setopt($ch, SO

我正在试图找到一个解决方案,将实时订单发送到收据打印机

基本上是伪代码:

if ($order == 'success')
{
    $printer = ip.to.remove.printer;

    $receipt_text = 'You just received an order!';

    $ch = curl_init('http://addresstosomekindofapi.com/print_receipt/');
    curl_setopt($ch, SOME_OPTION, 0).............;

    curl_exec($ch);
    curl_close($ch);
}
我只是在探索完成这件事的方法。如果能够做到这一点,而不是发送常常会占用线路的传真,那将是非常棒的

怎样才能做到这一点呢?

有些打印机(我想像你基本的office hp laserjets)可以做到这一点

  • 通过ftp联系
  • 具有纸张选择的“虚拟打印机”模式
如果我是你,我会调查的


(这是假设打印机和php文件之间存在某种网络分离。)

对我来说,一个可靠的解决方案是构建一个桌面应用程序,该应用程序连接到web应用程序,并能够将作业发送到打印机。我认为web应用程序无法控制用户的打印作业。

我认为最好的解决方案是使用
php
类将文档打印为pdf。这类课程相当多。一个好的方法是
ezpdf
类,可以从下载,或者你试过jZebra吗?好:直接与连接到客户端工作站的打印机对话。坏:需要java。看看吧:什么样的桌面库能帮上忙,我找到了Jasper,但它很复杂,而且非常大