xiidea / php-esc-pos
此包已被 废弃 且不再维护。未建议替代包。
EPSON ESC/POS 打印机命令生成库
dev-master
2016-04-12 02:55 UTC
Requires
- php: >=5.3.0
- hyperthese/php-serial: dev-master
- intervention/image: dev-master
Requires (Dev)
- phpunit/phpunit: ~4.4
Suggests
- endroid/qrcode: Require when you want to print QRCode
- hyperthese/php-serial: Allows Communicate with devices connected over Serial port
- intervention/image: Require when you want to print image
This package is auto-updated.
Last update: 2021-07-15 06:39:51 UTC
README
注意: 此库不再维护。我不会回答问题或拉取请求,因为我不再使用此项目,也没有时间工作于它。如果您想继续开发,请随意分叉它。或者,您也可以使用 此 库。
此库实现了 Epson ESC/POS 协议的热敏打印机子集。它允许您在兼容打印机上使用基本格式、切割和条形码打印收据。
它适用于 Epson TM-T70 型号,但其他由 Epson 或其他供应商生产的打印机,如果使用相同标准,也可能工作。
基本用法
<?php //$device = new \Epson\Devices\NetworkPrinter('10.x.x.x'); $device = \Epson\Devices\Serial::create('/dev/tty0'); $printer = new \Epson\Printer($device); $printer -> text("Hello World!\n"); $printer -> cut();
归属
此库是 Michael Billington 实现的与 ESC/POS 热敏打印机一起工作的库 escpos-php 的修改版本。更多文档可在 https://github.com/mike42/escpos-php 查找。
单元测试
在同一文件夹中进行 composer 安装后
./vendor/bin/phpunit