Forum Moderators: coopster
Everything is fine except one thing. I simply can't work out how to send the modified Postscript data to the printer! Any help, please?
I have a Windows XP machine with PHP and Apache, and a HP 5100 LaserJet printed (PCL and PS) on a JetDirect wireless server card.
This means that on the Windows command line I can do this:
lpr -S 192.168.1.4 -P HPLaserJet5100 filename
as well as print from within applications by the normal method.
However, I can't work out what PHP commands I should use to send a file, or a PHP string var (containing the entire Postscript data), to the printer! I can't pipe data in an lpr command, can I? I tried printer_open() printer_write(), etc, but that just made the printer print the Postscript as raw text without interpreting it! How do I communicate properly with the printer?
thanks,
Michael
$handle = printer_open();
printer_set_option($handle, PRINTER_MODE, "raw");
printer_write($handle,$myfile);
printer_close($handle);
There isn't enough in the manual to tell me that I might need to set the options. It's not very detailed compared to the other sections of the manual.
Michael