I don't know if it sounds crazy, but here's the scenario -
I need to print a document over the internet. My pc ClientX initiates the process using the web browser to access a ServerY on the internet and the printer is connected to a ClientZ (may be yours). 1. The document is stored o开发者_如何学编程n ServerY. 2. ClientZ is purely a cliet; no IIS, no print server etc. 3. I have the specific details of ClientZ, IP, Port, etc. 4. It'll be completely a server side application (and no client-side on ClientZ) with ASP.NET & C# - so, is it possible? If yes, please give some clue. Thanks advanced.This is kind of to big of a question for SO but basically what you need to do is
- upload files to the server -- trivial
- do some stuff to figure out if they are allowed to print the document -- trivial to hard depending on scope
- add items to a queue for printing and associate them with a user/session -- easy
- render and print the document -- trivial to hard depending on scope
- notify the user that the document has been printed
- handling errors
the big unknowns here are scope, if this is for a school project you probably don't have to worry about billing or queue priority in step two. If its for a commercial product billing can be a significant subsystem in its self.
the difficulty in step 4 depends directly on what formats you are going to support as many formats are going to require document specific libraries or applications. There are also security considerations here if this is a commercial product since it isn't safe to try to render all types of files.
Notifications can be easy or hard depending on how you want to do it. You can post back to the html page, but depending on how long its going to take for a job to complete it might be nice to have an email option as well.
You also need to think about errors. What is going to happen when paper or toner runs out or when someone tries to print something on A4 paper? Someone has to be notified so that jobs don't just build up.
On the server I would run just the user interaction piece on the web and have a "print daemon" running as a service to manage getting the documents printed and monitoring their status. I would use WCF to do IPC between the two.
Within the print daemon you are going to need a set of components to print different kinds of documents. I would make one assembly per type (or cluster of types) and load them into your service as plugins using MEF.
sorry this is so general, but you are asking a pretty general and difficult to answer question.
精彩评论