.net 4 的复杂打印任务支持
我一直在寻找允许将文档(pdf、txt、doc 等)发送到网络打印机的工具。
我知道 PrintDocument、Graphics 将文本打印到打印机。我正在寻找的是简单且噪音较小的解决方案来实现它
,即
using(printer p = new XPrinter)
{
p.filename = "C:\\1.txt";
p.printername ="\\network1\mainprinter";
p.print();
}
是否有任何开源或第三方工具可用于简化 dotnet 4.. winform/wpf 中的打印。 或任何实现它的想法。
编辑 理想情况下,我想在服务器上安装此打印应用程序,然后根据要求在网络打印机上完成打印请求。
I have been looking for tools which will allow to send documents (pdf,txt,doc,etc) to network printer.
I am aware of the PrintDocument, Graphics to print text to Printer. what I am looking for is easy and less noise solution to achieve it
i.e.
using(printer p = new XPrinter)
{
p.filename = "C:\\1.txt";
p.printername ="\\network1\mainprinter";
p.print();
}
Are there any open source or 3rd party tools available to ease printing in dotnet 4.. winform/wpf.
or any ideas to achieve it.
EDIT
Ideally I want to install this printing application on server and then complete print requests on network printer as requested.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为打印机设置复杂文档类型(例如 .pdf 和 .doc)的格式并不是您想要涉及的内容。您甚至需要大量软件才能读取该文件,更不用说格式化它了。这总是毫无意义的,用户已经拥有处理安装在其计算机上的文件格式的本机应用程序。 Microsoft Office、Adobe Reader 等。Windows
中有一个用于打印文件的标准协议。您使用 Process 和 ProcessStartInfo 类。将文件名设置为文件的路径,动词设置为“打印”。 Process.Start() 表示,本机应用程序将打印文档。当您在资源管理器中右键单击该文件并单击“打印”时,您会得到同样的结果。
Formatting complex document types like .pdf and .doc for a printer is not something you'd want to get into. You'll need gobs of software to even read the file, let alone format it. And it is invariably pointless, the user will already have the native application that handles the file format installed on her machine. Microsoft Office, Adobe Reader, etc.
There's a standard protocol in Windows to get files printed. You use the Process and ProcessStartInfo classes. Set the filename to the path of the file, the Verb to "Print". Process.Start() that, the native app will print the document. Same thing you get when you right-click the file in Explorer and click Print.
根据其他帖子,似乎 http://itextpdf.com/ 似乎是一个不错的选择。我没用过,所以无论好坏我都不会。 HTH。
According to other posts, it seems like http://itextpdf.com/ seems to be a good option. I have not used it so I would not if it is good or not. HTH.