PHP print files in directory to printer -
i'm trying print files directly html button called print , code:
if($handle = printer_open("\\\\servername\\printername")){ printer_set_option($handle, printer_mode, "raw"); $output = "file.pdf"; printer_write($handle,$output); printer_close($handle); }
but, code doesn't work, did miss something?
if put echo "test"
inside if statement, echoed, , means printer path correct, right?
the function printer_open not native php call. exists in specific packages available online, not work without recompiling php package installed. useful script others, including myself, have used in past hand directly system call.
system("lp $filename");
there many options can add in system call; 1 option needed destination printer. can check man page lp details.
Comments
Post a Comment