我正在使用此库:https://github.com/mike42/escpos-php
第一个例子
<?php
require __DIR__ . '/vendor/mike42/escpos-php/autoload.php';
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\Printer;
$connector = new FilePrintConnector("php://stdout");
$printer = new Printer($connector);
$printer -> text("Hello World!\n");
$printer -> cut();
$printer -> close();
什么都没发生。当我转储$connector
时,我会看到通知:
object(Mike42\Escpos\PrintConnectors\FilePrintConnector)#2
(1) { ["fp":protected]=> resource(6) of type (stream) }
Notice: Print connector was not finalized. Did you forget to close the printer?
in C:\xampp\htdocs\test\vendor\mike42\escpos-php\src\Mike42\Escpos\PrintConnectors\FilePrintConnector.php on line 44
我的终端通过bluethooth连接。我正在使用Windows10。
我应该如何连接? FilePrintConnector
构造函数中传递的参数应该是什么?