Hello,

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?

Recommended Answers

All 2 Replies

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:

<?php
exec('lp -h 123.123.123.123 filename.txt');
?>

where 123.123.123.123 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! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.