通过服务器从一个客户端打印到另一个客户端
我不知道这听起来是否疯狂,但这就是场景 -
我需要通过互联网打印一份文档。我的电脑 ClientX 使用网络浏览器启动该过程以访问互联网上的 ServerY,并且打印机连接到 ClientZ(可能是您的)。
1. 文档存储在ServerY上。
2. ClientZ纯粹是一个客户端;没有 IIS、没有打印服务器等
3. 我有ClientZ、IP、端口等具体详细信息
4. 它将完全是一个使用 ASP.NET 和 ASP.NET 的服务器端应用程序(ClientZ 上没有客户端)。 C#
- 那么,这可能吗?如果是,请提供一些线索。感谢先进。
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 on 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于SO来说,这是一个很大的问题,但基本上你需要做的就是
这里最大的未知数是范围,如果这个用于学校项目,您可能不必担心关于第二步中的计费或队列优先级。如果它用于商业产品,计费本身就是一个重要的子系统。
第 4 步的难度直接取决于您要支持的格式,因为许多格式需要文档特定的库或应用程序。如果这是商业产品,这里还需要考虑安全性,因为尝试渲染所有类型的文件并不安全。
通知可以很简单也可以很困难,具体取决于您想要如何执行。您可以发回 html 页面,但根据完成作业所需的时间,最好也有一个电子邮件选项。
您还需要考虑错误。当纸张或碳粉用完或者有人尝试在 A4 纸上打印内容时会发生什么情况?必须通知某人,这样工作岗位才不会增加。
在服务器上,我将只运行网络上的用户交互部分,并运行一个“打印守护进程”作为服务来管理打印文档并监视其状态。我会使用 WCF 在两者之间进行 IPC。
在打印守护程序中,您将需要一组组件来打印不同类型的文档。我将为每种类型(或类型簇)制作一个程序集,并使用 MEF 将它们作为插件加载到您的服务中。
抱歉,这太笼统了,但您问的是一个非常笼统且难以回答的问题。
This is kind of to big of a question for SO but basically what you need to do is
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.