Skip to content
📄 A driver for Epson ESC/POS thermal printers written in PHP.
PHP
Branch: master
Clone or download
Latest commit 1f7eedd Dec 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src Removed tabs, filled with whitespaces. Jun 29, 2019
LICENSE
README.md

README.md

escpos-php-driver

A driver for Epson ESC/POS thermal printers written in PHP.
My printer is the Hoinprinter 80mm Thermal Printer.

Usage:

Include the /src/driver.php file in your project. The printer is initialized inside the driver.php file.

To output some text you have to echo your text with the printer_text('your text here'); function and send it via netcat to your printer.

Example:

print.php

<?php
require_once("/path/to/driver.php");
echo printer_text("foo bar");
printer_feed(2);
printer_cut();
?>

You need to know the IP-address of your printer and print via netcat:
$ php print.php | nc ip.of.your.printer 9100 -w 1

Functions:

To check out every available function, please refer to the comments in driver.php

You can’t perform that action at this time.