how to print on client printer from server using php
I want to print a pdf file(pdf file is on server) using php (php is also running on server) on clie开发者_开发知识库nt computer.
How can I do this.
Thanks in advance for you help
You cannot do this directly, as the php/apache server runs on a completely different computer(and maybe geographic location) than the browser/client.
You can however use intermediate solutions, like
- proprietary, custom applications installed on the client's computer that "talks" to the server and requests files to be printed. These should be cross-platform in some way or another
- browser addons, separate addon for every possible browser, if it can support addons:)
- special "pdf" viewers, that cannot actually view, but only prints pdf's, installed on the client's computer.
- the server connects to the clients computers printer(the client has to share the printer first though) and tries to print through it
All these are just ugly hacks, used in conjunction with a badly designed application/workflow in that application, so be very carefull if you really want this...
As the PHP-printer methods are only available on Win-systems, you should use the methods, which are provided for printing by the underlying OS (e.g. some Liunx distro) and call the accordant shell-commands from PHP.
But of course you can!!!
What I would do is to open up the page in the client's browser and have javascript prompt the user to print the document out. hope this helps
精彩评论