【发布时间】:2017-07-28 19:08:27
【问题描述】:
我已经有很多时间使用 php,但是我遇到了一个与票证打印相关的项目,事实上与此相关的库并不多,而我发现的一个叫做 mike 42 的库正在给我库中的示例存在许多问题,然后继续应用程序。问题是没有太多与可能导致的错误相关的文档。
我遇到的错误信息是:
警告:复制(\Luis_Enrique\EPSON TM-T20 Receipt):无法打开流:C:\wamp\www\Probar_Ticket\src\Mike42\Escpos\PrintConnectors\WindowsPrintConnector.php 中没有这样的文件或目录在线372
这是我的代码:
require __DIR__ . '/../autoload.php';
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\PrintConnectors\CupsPrintConnector;
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;
// Enter the device file for your USB printer here
try {
/* add to the printer */
$connector = new WindowsPrintConnector("EPSON TM-T20 Receipt");
$printer = new Printer($connector);
/* write */
$printer->text("Hola Mundo!\n");
/* Cut tiket */
$printer->cut();
/* Close printer */
$printer->close();
} catch (Exception $e) {
echo "Couldn't print to this printer: " . $e->getMessage() . "\n";
}
错误不是在代码中,在需要特定权限的 wampserver 中,或者在尝试打印机与库无法比较的情况下,而且我认为该库缺少很多文档.或者不知道他们是否知道其他一些图书馆。?
【问题讨论】: