How to automatically send print job from “Cloud” server to printer?

梦想的初衷 提交于 2019-12-04 14:07:19

问题


A picture is supposed to be worth a 1000 words, so let's see if that can shorten this post up a bit... Essentially, I'm looking into "how" to code a solution that runs on the web server within the cloud that will send a print command to a printer within office 1 (label printer).

The print job is really part of work flow within the ASP.NET web application and I would like to keep all of the code within a single application if possible. How can I go about doing this?

Due to security, I should avoid creating a new application within Office 1 that pulls data from the "cloud" and have the "cloud" be used to push the command downward. I'm really looking at this from a code standpoint within the ASP.NET app and also potentially transcending into more of a serverfault/superuser question on the printer. I'll save that for a future question there though.


回答1:


From a coding perspective, starting with version 3.0 of the framework, there is the System.Printing namespace, which provides classes for sending print jobs to a local, remote, or dedicated printer appliance. In particular, classes of interest may be PrinServer, PrintQueue, and PrintTicket.

For versions of the framework prior to 3.0, you can use the spooler api functions to accomplish similiar tasks. You can find some pinvoke signatures at pinvoke.net.




回答2:


Another alternative is using Google Cloud Print.

While the repo is for Mono, it should work for C#.

GitHub MonoGCP.



来源:https://stackoverflow.com/questions/3534925/how-to-automatically-send-print-job-from-cloud-server-to-printer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!