print to a network printer using PHP
13,262
Sure is. If you are on Linux do use LPR.
exec("lpr -P 'printer' -r 'filename.txt'");
More on LPR commands. Take a look into LPR docs. You can easily show the print-queue and more from PHP.
If you are on Windows use print
exec("print /d:LPT2: C:\filename.txt");
More on print syntax
Or take a look into this guide that has a deeper explanation of command-line printing.
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on June 11, 2022Comments
-
Admin about 2 years
is it possible to print directly to a network printer with PHP using LPR or something similar?
any pointers?
thanks.
-
Innovative Thinker about 10 yearsfor windows is there any options\