fun7984 Posted July 30, 2010 Share Posted July 30, 2010 I have a code to connect into network printer. It is use to fread the PDF drawing or file then send it to network printer. It is working fine in KONICA MINOLTA BH500 printer but it is not working in Canon iR3245 PCL printer. When i send the content of file into Canon printer, the printer produce some funny output (printed funny characters). Please help to solve this issues, i been facing it sometime. Thanks in advance. Example Code:- function SendDocToPrinter($PrinterName,$DocName) { if($ph = printer_open($PrinterName)) { // Get file contents $fh = fopen($DocName, "rb"); $content = fread($fh, filesize($DocName)); fclose($fh); // Set print mode to RAW and send PDF to printer printer_set_option($ph, PRINTER_MODE, "RAW"); printer_write($ph, $content); printer_close($ph); echo "<br>Document Printed<br>"; return 1; }else { return 0; } } Link to comment https://forums.phpfreaks.com/topic/209314-php-printer_write/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.