title: automatically printing using php
body: <p>I have pdf files coming in a folder after some duration. I want to print them using php automatically by default printer and after printing those files move to other folder. How can I do this? I am using the code given below but it's not printing anything..Please help..</p>
  
  <pre><code>$printer = "\\\\server\printer";
  
  if($ph = printer_open($printer))
  {  
     $fh = file_get_contents('455.pdf');
  
     printer_set_option($ph, PRINTER_MODE, "RAW"); 
     printer_write($ph, $fh); 
     printer_close($ph); 
  } 
  
  else 
     echo "Can't connect to printer"; 
  </code></pre>