PHP Printing Help
Posted: Fri Nov 02, 2007 4:35 pm
I am working to port over a set of Inkjet print request pages from an OS X based server to a Windows 2003 one. While I have worked out most of the bugs there are a couple that elude me. The main one that I would like help on is to fix the mechanism that automatically prints a sheet of paper with the request when it is submitted online.
The code below is what works on the OS X server:
All the code seems to work fine on the Windows server except for the line that actually prints the file. I tried replacing "lpr" with "print" but I got the error "Unable to initialize device PRN". I googled this error and followed the instructions to map the networked printer to the DOS LP1 port but it did not work. Is there either a way to fix this or a better way to print using PHP?
Thanks a ton.
Jake
The code below is what works on the OS X server:
Code: Select all
//create new file
$ourFileName = "./uploads/order3800.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fwrite($ourFileHandle, $print_message);
//close file
fclose($ourFileHandle);
//systems calls to print and delete the file called "order"
system("lpr ./uploads/order3800.txt");
system("rm ./uploads/order3800.txt");Thanks a ton.
Jake