Closed RushNetMx closed 9 years ago
Hi RushNetMx,
USB/Windows as a combination is marked "not tested", as I haven't figured out a way to get a direct file pointer to the printer. This means that you are not really in beginner territory! I'll offer some tips, with the disclaimer that I've never used escpos-php under this setup.
The go-to setup appears to involve installing the printer as a text-only device, then sending it pre-made text files:
//machine/printer
.tmpfile()
, fopen()
it and run the driver.copy()
the result to //machine/printer
before deleting the text file.And the alternative would be to send data using the port name. I'm not sure whether you need the printer "installed" with the text only driver to get this working:
tmpfile()
, fopen()
it and run the driver. fclose()
when done.Print the file, then delete it. It
$printer = "USB001";
$file = (tmp file path)
system("print /d:$printer: $file");
unlink($file);
The third and slightly clunkier alternative is leverage the fact that Windows/Ethernet and Linux/USB are both known to work, and to to slip in a Raspberry Pi, using something like netcat
as an intermediary to make your printer available from Windows over the network.
I have a windows VM, so no guarantees, but if I can get one of these working in the coming days, I'll be sure to wrap it into an actual working example.
Hello again,
I've been working on some improvements in this space, and can confirm that I've had a USB printer working on Windows 7. I've posted more extensive details at question #14 (Print from a USB connected printer under Windows)
Best of luck,
Hi! Thanks for your help, I'm going to do some tests, i'm beginner programming for php, so i hope make it. Many thanks for everything. Regards.
Hello, i´m new in php and I need print a ticket in a esc/pos thermal printer. Actually is connected in usb in Windows 7, can you help or guide me how can i do this using escpos-php, and also I need open a cash box. Thanks, any help is appreciated.