I am using ESC/POS Print Driver for PHP (https://github.com/mike42/escpos-php/) for thermal printing ,
I have successfully took my first print with following code :
require __DIR__ . '/autoload.php';
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\NetworkPrintConnector;
$connector = new NetworkPrintConnector("192.xxx.x.xxx");
$printer = new Printer($connector);
$printer -> text("this is my first print");
$printer -> feed();
$printer -> feed();
$printer -> cut();
$printer -> close();
Now, I want that if printer is not working then an error should display to user (basic troubleshoot like Plug is off, power disconnected, out of paper.)
Please suggest me an option to do this.
Thanks in Advance