diff --git a/printlib.php b/printlib.php index b699537..c00e569 100644 --- a/printlib.php +++ b/printlib.php @@ -4,9 +4,17 @@ define("MAX_STR", 32); define("ESC", "\x1b"); define("GS", "\x1d"); define("LF", "\x0a"); -define("PORT", "/dev/usb/lp0") -function initprint() {} -function println($data) {} +define("PORT", "/dev/usb/lp0"); +function initprint() { + return file_put_contents(PORT, ESC . "@"); +} +function println($data) { + if (strlen($data)