有人能帮忙吗?
你好,我用"EPSON TM-T82II收据"打印账单。我使用php代码
<?php
require_once(dirname(__FILE__) . "/Escpos.php");
try {
$connector = null;
$connector = new WindowsPrintConnector("EPSON TM-T82II Receipt");
/* Print a "Hello world" receipt" */
$printer = new Escpos($connector);
$printer -> text("Hello World!n");
$printer -> cut();
/* Close printer */
$printer -> close();
} catch(Exception $e) {
echo "Couldn't print to this printer: " . $e -> getMessage() . "n";
}
Iam getting this error "Couldn't print to this printer: Printer
"EPSON TM-T82II收据"无效。使用本地端口(LPT1, COM1等)或者smb://计算机/打印机符号。"
您应该完全按照错误提示进行操作-您需要使用WindowsPrintConnector("LPT1")
或WindowsPrintConnector("smb://XXX")
而不是WindowsPrintConnector("EPSON TM-T82II Receipt")
,其中XXX是您的打印机的网络路径