3

I want to print a pdf file(pdf file is on server) using php (php is also running on server) on client computer.

How can I do this.

Thanks in advance for you help

Shivomkara Chaturvedi
  • 1,697
  • 7
  • 28
  • 42
  • I'm gonna go out on a limb and say "You can't" - but I'm not posting that as an answer in case someone else has a very clever trick up their sleeve... – DaveRandom Aug 30 '11 at 11:41

3 Answers3

4

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...

Quamis
  • 10,924
  • 12
  • 50
  • 66
1

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

Segebee
  • 69
  • 6