php - How to Send a print job from Hosting server to loacal pc? -
I need help with php printing from the printer. I tried some code for printing my work on the local host but uploading It is not visible after anything I used the code
$ getprt = printer_list (PRINTER_ENUM_LOCAL); // Resonance 'Printer List'. Json_encode ($ getprt). '& Lt; Br / & gt; '; $ Printer = $ getprt [4] ['NAME']; Counterpart $ printer; If ($ ph = printer_open ($ printer)) {// Get the contents of the file $ FH = FOPAN ("filename.txt", "rb"); $ Content = fread ($ fh, fileseek ("filename.txt"); Fclose ($ fh); // Set RAD to print mode and send PDF to printer printer_set_rection ($ PH, PRINTER_MODE, "RAW"); Printer_write ($ pH, $ content); Printer_close ($ pH)
This shows the printer on the local host, but when I upload and call this page it does not show any show or does nothing. Actually I want to select print from printers list but for testing I set it manually, this list shows when I run website form localhost, but the hosting server does not support my problem I do not have experience about it.
Remember that PHP runs on the server and the client is not on the PC. That's why your code is looking for printers on your hosting package, and there will be no one else, and even if there are too many of your site to become useless for the user
Javascript will need to be used.
With Javascript you can get the browser to load the standard print dialog, such as
However, it just prints the current page. So you need to re-develop this process so that you throw a web page that looks like the print of the user's will.
Then there should be javascript up and the user at the bottom of the page there are local printers and the printers and any other options from the standard client print dialog should be able to choose.
Comments
Post a Comment