bladedanny Posted September 1, 2011 Posted September 1, 2011 Hi All, Does anyone know a way to print directly to a printer using PHP? So far I've been using javascript: window.print() Which does print what I want it to but displays the print dialog box. I'd like it to go straight to either the client default printer or to a printer attached to the webserver. Thanks, Dan
bladedanny Posted September 1, 2011 Author Posted September 1, 2011 Hi All, After some playing around with PHP and Shell I've used the following method that works quite well. I thought I'd post it on here for others if they ever needed it. shell_exec('lpr -P $Printer $file'); Which basically prints $file to $printer (that is a printer installed on the server.) Dan
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now