escpos-php
escpos-php copied to clipboard
QR codes are not supported on your printer (Epson TM T-20)
Hello! I have an Epson TM T-20 installed, and i'm trying to print a QrCode. My printer is connected to my computer by USB cable, and installed with the spooler driver.
When i try to print the QrCode, i get this error:
Fatal error: Uncaught Exception: QR codes are not supported on your printer. in C:\xampp\htdocs\vendor\mike42\escpos-php\src\Mike42\Escpos\Printer.php:717 Stack trace: #0 C:\xampp\htdocs\index.php(108): Mike42\Escpos\Printer->qrCode('01234567890', 0, 3, 2) #1 C:\xampp\htdocs\index.php(134): imprimirDados(Array) #2 {main} thrown in C:\xampp\htdocs\vendor\mike42\escpos-php\src\Mike42\Escpos\Printer.php on line 717
My code is this:
$profile = CapabilityProfile::load("simple");
$connector = new WindowsPrintConnector("epsontmt20");
$printer = new Printer($connector, $profile);
$printer->setPrintLeftMargin(10);
$printer->feed(2);
$printer->qrCode("01234567890", Printer::QR_ECLEVEL_L, 3, Printer::QR_MODEL_2);
$printer->feed(1);
$printer->cut();
$printer->close();
Is there any solution to this problem? I would really apreciate any help! Thanks in advance.