Created
May 20, 2020 16:59
-
-
Save Encang-Cutbray/c846fd705466d112db4bb4b60e4dbbe4 to your computer and use it in GitHub Desktop.
Revisions
-
Encang-Cutbray created this gist
May 20, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ require __DIR__ . '/vendor/autoload.php'; use Mike42\Escpos\Printer; use Mike42\Escpos\PrintConnectors\WindowsPrintConnector; try { $connector = null; $connector = new WindowsPrintConnector("xp-58"); $printer = new Printer($connector); $printer->text('kopi'); $printer->text("Hello World!\n"); $printer->cut(); $printer->close(); return 'kopi'; } catch (\Exception $e) { echo "Couldn't print to this printer: " . $e->getMessage() . "\n"; }