I'm trying to print a QR Code with my Epson TM-T88IV serial printer using php. However, my php file installed on a server and I'm able to call it succesfully from a html file. I'm using a library called ESCPOS-PHP (https://github.com/mike42/escpos-php) and the computer is running Windows XP Professional. Here's my php snippet (there's more in the middle, but not needed for the printing action):
<?php
require __DIR__. '/escpos-php-master/Escpos.php';
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
[...]
try {
$connector = new WindowsPrintConnector("EPSON TM-T88IV Receipt");
$printer = new Escpos($connector);
$printer -> text("Hello World!\n");
$printer -> cut();
// Close printer
$printer -> close();
} catch(Exception $e) {
echo "Couldn't print to this printer: " . $e -> getMessage() . "\n";
}
?>
Seems like I just can't connect to the printer. I also tried with
$connector = new FilePrintConnector("/dev/ttyS0");
$printer = new Printer($connector);
Which is supposed to be the way with serial printer (I'm not sure what I should put instead of "/dev/ttsyS0"). Maybe I shouldn't try to trigger it via the server ? I'm doing it because I can't modify his POS system (Maitre D) and I need an easy way to print QR code on bills. If you know any workaroung, any advice would be appreciated ! Thanks