mike42 / escpos-php

PHP library for printing to ESC/POS-compatible thermal and impact printers
Other
2.57k stars 862 forks source link

Windows 7 USB print support question #9

Closed RushNetMx closed 9 years ago

RushNetMx commented 9 years ago

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.

mike42 commented 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:

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:

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.

mike42 commented 9 years ago

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,

RushNetMx commented 9 years ago

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.