I want to build a system that allows me to print a document (from a input field) and it prints at my home.
Basically, if I'm out I have an input box that if I upload a file to it, it will print for when I get home. Same if I was sat downstairs I didn't have to mess around with the networking with it.

My printer is always connected to the internet (via my network)

Is this possible, in php?

7 Years
Discussion Span
Last Post by cereal

In php it is unreal.
You may generate a page for print on php and then use javascript to put the page on print.


Maybe you can. On linux the command lp permits you to print to a remote printer. So if the php script runs on a linux box and makes use of system() or exec() you can print, an example:

exec('lp -h filename.txt');

where is the remote ip of your printer. You'll probably have to convert some types of files before you can print them, check here:

- http://tldp.org/HOWTO/pdf/Printing-Usage-HOWTO.pdf

More reference:
- http://linux.about.com/od/itl_guide/a/gdeitl62t00.htm
- http://unixhelp.ed.ac.uk/CGI/man-cgi?lp
- http://php.net/manual/en/function.exec.php

good luck! :)

Edited by cereal: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.