Created
May 20, 2020 16:59
-
-
Save Encang-Cutbray/c846fd705466d112db4bb4b60e4dbbe4 to your computer and use it in GitHub Desktop.
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 characters
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"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment