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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -