Direct print to a COM Port 3 Printer
Posted: Wed Oct 21, 2009 5:48 am
Hi,
I am building a site and at certain points in the site, I need to fire off some code that tells a receipt printer to print off what I tell it to.
I found some code that works if the printer is plugged into a parallel port (see below)
However, my client has been fairly specific in telling me that the printer MUST be plugged into Comm Port 3.
I tried altering the code above to use 'COM3' instead of 'PRN' but no result.
Basically, is there anyway to get PHP to automatically print without having to use a print prompt window (for example by using the js window.print() function). I know my client will not like the idea of users having to click another button.
Is there anyway to do this? Or is it possible that I can auto print a pdf file. I just want to exhaust all options before telling my client he is going to have to use a print window.
Thanks for any help and if you need more info, let me know.
P.S. If it makes any difference to how it would work, the printer I am using is an Epson Thermal line Printer TM-T88III
I am building a site and at certain points in the site, I need to fire off some code that tells a receipt printer to print off what I tell it to.
I found some code that works if the printer is plugged into a parallel port (see below)
Code: Select all
$handle = fopen('PRN', "w"); // note 1
fwrite($handle, 'text to printer'); // note 2
fclose($handle); // note 3I tried altering the code above to use 'COM3' instead of 'PRN' but no result.
Basically, is there anyway to get PHP to automatically print without having to use a print prompt window (for example by using the js window.print() function). I know my client will not like the idea of users having to click another button.
Is there anyway to do this? Or is it possible that I can auto print a pdf file. I just want to exhaust all options before telling my client he is going to have to use a print window.
Thanks for any help and if you need more info, let me know.
P.S. If it makes any difference to how it would work, the printer I am using is an Epson Thermal line Printer TM-T88III