I can print easily from my pc connected with usb pos machine.I have installed driver , so that it works fine.
EscPos.php
try {
// Enter the device file for your USB printer here
// You can check the tutorial here: https://mike42.me/blog/2015-03-getting-a-usb-receipt-printer-working-on-linux
$connector = new FilePrintConnector("/dev/usb/lp0");
/* Print a "Hello world" receipt" */
$printer = new Printer($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";
}
myform.php
when i submitted a form data , it is redirecting escpos.php for printing and it prints.
but i don't want like that.
I want when i will submit form, it will be print directly current page without redirecting to escpos.php.