vendredi 7 août 2015

How to connect printer through php code?

I have developed web application for restaurant and i am trying to connect printer through php code. JavaScript print function is working fine but it opens browser print dialogue to give command to printer but i want to connect it with directly through php. I tried a lot by surfing on internet but i am not being able to connect printer through php code. I have found code on internet and tried with it but it shows error on line number 3. I have attached the code below. Please tell me what is the error on line number 3? Thank you so much in advance. :)

<?php 
 // start printer 
$handle = printer_open("Samsung SCX-4x21Series"); 
printer_start_doc($handle, "My Document");
 printer_start_page($handle); // create content here // print
 printer_end_page($handle); printer_end_doc($handle);
 printer_close($handle); ?>




Aucun commentaire:

Enregistrer un commentaire