Click here to Skip to main content
15,847,077 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I have a bit of an unusual requirement. I have a website that has a specific use and one of the key things is to be able to print on the client machine to a printer connected to that machine. It's a label printer and requires specific coding, so I can print through the browser.

One solution I'm investigating is using WCF. The idea is that when the user clicks print the web page would then call WCF service running on the client and send the specifics of the print job to it. The service could then send the data to the printer.

The client machine is on a network and is browsing the internet, the web server is not on that network. So, how does the server find the WCF service running on the client?

The slight variation I thought of was to have a service on the web server and the clients regularly poll that service to see if there's a new print job for them. Not as neat, and I still need to make sure that each client only picks up the print jobs for them. Is it easy to distinguish the clients?

I'm quite new to WCF so I'm hoping I'm just missing something obvious.


1 solution

When the user clicks "print page", he's doing that on the client machine where the printer is connected to, did I understand that correctly?
Then it is not necessary to involve the server again. Things have to be handled on the client.
I'd install a small program on the client which does the actual printing job. It is called by click on that link - for that purpose you must "invent" your own URL type and register it in the registry. Take a look at HKEY_CLASSES_ROOT\http how to do it, the link could then look like <a href="printme:///C:/temp/myfile.dat">print page</a>
Share this answer
Hi Bernhard,

Yes, you understood correctly. Your solution is probably better than what I was trying to do, so I'm going to give that a go. Now I've just got to wait for this to become my top priority again :)


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900